]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
imdb plugin: TV series are not shown by default when looking for movies by person...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 7 Apr 2007 12:05:10 +0000 (12:05 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 7 Apr 2007 12:05:10 +0000 (12:05 +0000)
data/rbot/plugins/imdb.rb

index ee6b59fe65b395d7453dabac6843ef572b8ace1e..b969ba963c5dc36255d79ab93aa565a83721ad1f 100644 (file)
@@ -286,6 +286,9 @@ class Imdb
         (aclip == quot ? 1 : -1) <=> (bclip == quot ? 1 : -1)
       }.each { |url, pre_title, pre_roles|
         title = fix_article(pre_title.ircify_html)
+        if title[0] == ?" and not @bot.config['imdb.tv_series_in_movies']
+          next
+        end
         role_array = []
         pre_roles.strip.scan(/\[([^\]]+)\]((?:\s+\([^\[]+\))+)?/) { |txt, comm|
           if txt.match(/^(.*)\s+\.\.\.\.\s+(.*)$/)
@@ -323,6 +326,9 @@ class ImdbPlugin < Plugin
   BotConfig.register BotConfigBooleanValue.new('imdb.fix_article',
     :default => false,
     :desc => "Try to detect an article placed at the end and move it in front of the title")
+  BotConfig.register BotConfigBooleanValue.new('imdb.tv_series_in_movies',
+    :default => false,
+    :desc => "Whether searching movies by person/year should also return TV series")
 
   def help(plugin, topic="")
     "imdb <string> => search http://www.imdb.org for <string>: prefix <string> with 'name' or 'title' if you only want to search for people or films respectively, e.g.: imdb name ed wood"