summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-06 23:51:52 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-06 23:51:52 +0000
commit93c89892b9603bda7665e0ae490ad0935da2ba84 (patch)
treeb82e52ad1691f1c3570e2e429178d805b74d01e0
parentb5f558e15624a475d0051caf42d356d2ec50888f (diff)
imdb plugin: some titles with extra info where missed when searching for movies by person+year
-rw-r--r--data/rbot/plugins/imdb.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb
index e98a05c4..e5f3b7c2 100644
--- a/data/rbot/plugins/imdb.rb
+++ b/data/rbot/plugins/imdb.rb
@@ -202,7 +202,7 @@ class Imdb
if year = opts[:movies_in_year]
filmoyear = @bot.httputil.get(IMDB + sr + "filmoyear")
if filmoyear
- info << filmoyear.scan(/#{TITLE_MATCH} \(#{year}\)[^\]]*\[(.*)\](?:$|\s*<)/)
+ info << filmoyear.scan(/#{TITLE_MATCH} \(#{year}\)[^\]]*\[(.*)\]([^<]+)?(?:$|\s*<)/)
end
return info
end
@@ -276,15 +276,18 @@ class Imdb
data = info[1]
movies = []
- data.each { |url, pre_title, pre_roles|
+ data.each { |url, pre_title, pre_roles, extra|
title = fix_article(pre_title.ircify_html)
- roles = pre_roles.split(/\]\s+\[/).map { |txt|
+ role_array = pre_roles.split(/\]\s+\[/).map { |txt|
if txt.match(/^(.*)\s+\.\.\.\.\s+(.*)$/)
"#{$1} (#{$2})"
else
txt
end
- }.join(', ')
+ }
+ role_array.last << " " + extra.ircify_html if extra
+
+ roles = role_array.join(', ')
movies << [roles, title].join(": ")
}