]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
imdb plugin: make aka searches optional
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 5 Apr 2007 09:28:57 +0000 (09:28 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 5 Apr 2007 09:28:57 +0000 (09:28 +0000)
data/rbot/plugins/imdb.rb

index ad9bbf588c6c6f0408e84b5619f0e3d635c229a3..96501659d70f96d7d8d19eeb905505bc91c5ce31 100644 (file)
@@ -25,7 +25,8 @@ class Imdb
   end
 
   def search(rawstr)
-    str = URI.escape(rawstr) << ";site=aka"
+    str = URI.escape(rawstr)
+    str << ";site=aka" if @bot.config['imdb.aka']
     return do_search(str)
   end
 
@@ -245,6 +246,9 @@ class Imdb
 end
 
 class ImdbPlugin < Plugin
+  BotConfig.register BotConfigBooleanValue.new('imdb.aka',
+    :default => true,
+    :desc => "Look for IMDB matches also in translated titles and other 'also known as' information")
   BotConfig.register BotConfigBooleanValue.new('imdb.popular',
     :default => true,
     :desc => "Display info on popular IMDB entries matching the request closely")