From: Giuseppe Bilotta Date: Sat, 7 Apr 2007 12:05:10 +0000 (+0000) Subject: imdb plugin: TV series are not shown by default when looking for movies by person... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=a8c88dac4ec094b7b40ee622239d09742d6064be;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git imdb plugin: TV series are not shown by default when looking for movies by person/year, but they can be enabled with the imdb.tv_series_in_movies option --- diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb index ee6b59fe..b969ba96 100644 --- a/data/rbot/plugins/imdb.rb +++ b/data/rbot/plugins/imdb.rb @@ -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 => search http://www.imdb.org for : prefix with 'name' or 'title' if you only want to search for people or films respectively, e.g.: imdb name ed wood"