From 4921e40591c590a4fc61863666c89db5e940cf6b Mon Sep 17 00:00:00 2001 From: PrgmrBill Date: Tue, 9 Jun 2015 20:47:28 -0400 Subject: [PATCH 01/16] Fixes #55 - Adds IMDB plugin --- README.md | 1 + __init__.py | 45 +++++++++++++++++++++++++ config.py | 36 ++++++++++++++++++++ local/__init__.py | 1 + plugin.py | 84 +++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 1 + test.py | 15 +++++++++ 7 files changed, 183 insertions(+) create mode 100644 README.md create mode 100644 __init__.py create mode 100644 config.py create mode 100644 local/__init__.py create mode 100644 plugin.py create mode 100644 requirements.txt create mode 100644 test.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..f9fe2d4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Queries OMDB database for information about IMDB titles diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..f3aee73 --- /dev/null +++ b/__init__.py @@ -0,0 +1,45 @@ +### +# Copyright (c) 2015, PrgmrBill +# All rights reserved. +# +# +### + +""" +IMDB: Queries OMDB database for information about IMDB titles +""" + +import supybot +import supybot.world as world + +# Use this for the version of this plugin. You may wish to put a CVS keyword +# in here if you're keeping the plugin in CVS or some similar system. +__version__ = "" + +# XXX Replace this with an appropriate author or supybot.Author instance. +__author__ = supybot.authors.unknown + +# This is a dictionary mapping supybot.Author instances to lists of +# contributions. +__contributors__ = {} + +# This is a url where the most recent plugin package can be downloaded. +__url__ = '' + +from . import config +from . import plugin +from imp import reload +# In case we're being reloaded. +reload(config) +reload(plugin) +# Add more reloads here if you add third-party modules and want them to be +# reloaded when this plugin is reloaded. Don't forget to import them as well! + +if world.testing: + from . import test + +Class = plugin.Class +configure = config.configure + + +# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/config.py b/config.py new file mode 100644 index 0000000..e975b5b --- /dev/null +++ b/config.py @@ -0,0 +1,36 @@ +### +# Copyright (c) 2015, PrgmrBill +# All rights reserved. +# +# +### + +import supybot.conf as conf +import supybot.registry as registry +try: + from supybot.i18n import PluginInternationalization + _ = PluginInternationalization('IMDB') +except: + # Placeholder that allows to run the plugin on a bot + # without the i18n module + _ = lambda x: x + + +def configure(advanced): + # This will be called by supybot to configure this module. advanced is + # a bool that specifies whether the user identified themself as an advanced + # user or not. You should effect your configuration by manipulating the + # registry as appropriate. + from supybot.questions import expect, anything, something, yn + conf.registerPlugin('IMDB', True) + + +IMDB = conf.registerPlugin('IMDB') + +conf.registerGlobalValue(IMDB, 'template', + registry.String("$title ($year, $country) - Rating: $imdbRating :: $plot", _("""Template for the output of a search query."""))) + +conf.registerGlobalValue(IMDB, 'noResultsMessage', + registry.String("No results for that query.", _("""This message is sent when there are no results"""))) + +# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/local/__init__.py b/local/__init__.py new file mode 100644 index 0000000..e86e97b --- /dev/null +++ b/local/__init__.py @@ -0,0 +1 @@ +# Stub so local is a module, used for third-party modules diff --git a/plugin.py b/plugin.py new file mode 100644 index 0000000..d5097fe --- /dev/null +++ b/plugin.py @@ -0,0 +1,84 @@ +### +# Copyright (c) 2015, PrgmrBill +# All rights reserved. +# +# +### + +import supybot.utils as utils +from supybot.commands import * +import supybot.plugins as plugins +import supybot.ircutils as ircutils +import supybot.ircmsgs as ircmsgs +import supybot.callbacks as callbacks +import requests +from urllib import quote_plus +import json + +try: + from supybot.i18n import PluginInternationalization + _ = PluginInternationalization('IMDB') +except ImportError: + # Placeholder that allows to run the plugin on a bot + # without the i18n module + _ = lambda x: x + +class IMDB(callbacks.Plugin): + """Queries OMDB database for information about IMDB titles""" + threaded = True + + def imdb(self, irc, msg, args, query): + """ + Queries OMDB api for query + """ + encoded_query = quote_plus(query) + omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json" % (encoded_query) + channel = msg.args[0] + result = None + headers = { + "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.60 Safari/537.36" + } + + self.log.info("IMDB: requesting %s" % omdb_url) + + try: + request = requests.get(omdb_url, timeout=10, headers=headers) + + if request.status_code == requests.codes.ok: + response = json.loads(request.text) + + not_found = "Error" in response + unknown_error = response["Response"] != "True" + + if not_found or unknown_error: + self.log.info("IMDB: OMDB error for %s" % (omdb_url)) + else: + imdb_template = self.registryValue("template") + imdb_template = imdb_template.replace("$title", response["Title"]) + imdb_template = imdb_template.replace("$year", response["Year"]) + imdb_template = imdb_template.replace("$country", response["Country"]) + imdb_template = imdb_template.replace("$plot", response["Plot"]) + imdb_template = imdb_template.replace("$imdbRating", response["imdbRating"]) + + result = imdb_template + else: + self.log.error("IMDB OMDB API %s - %s" % (request.status_code, request.text)) + + except requests.exceptions.Timeout as e: + self.log.error("IMDB Timeout: %s" % (str(e))) + except requests.exceptions.ConnectionError as e: + self.log.error("IMDB ConnectionError: %s" % (str(e))) + except requests.exceptions.HTTPError as e: + self.log.error("IMDB HTTPError: %s" % (str(e))) + finally: + if result is not None: + irc.sendMsg(ircmsgs.privmsg(channel, result)) + else: + irc.error(self.registryValue("noResultsMessage")) + + imdb = wrap(imdb, ['text']) + +Class = IMDB + + +# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..663bd1f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 0000000..f38f323 --- /dev/null +++ b/test.py @@ -0,0 +1,15 @@ +### +# Copyright (c) 2015, PrgmrBill +# All rights reserved. +# +# +### + +from supybot.test import * + + +class IMDBTestCase(PluginTestCase): + plugins = ('IMDB',) + + +# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: From 18e971d7d678aa142335edc5e1aeff4217564458 Mon Sep 17 00:00:00 2001 From: butterscotchstallion Date: Sat, 17 Oct 2015 20:42:36 -0400 Subject: [PATCH 02/16] Updates attributions --- __init__.py | 2 +- config.py | 2 +- plugin.py | 2 +- test.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__init__.py b/__init__.py index f3aee73..2f383d9 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2015, PrgmrBill +# Copyright (c) 2015, butterscotchstallion # All rights reserved. # # diff --git a/config.py b/config.py index e975b5b..026788d 100644 --- a/config.py +++ b/config.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2015, PrgmrBill +# Copyright (c) 2015, butterscotchstallion # All rights reserved. # # diff --git a/plugin.py b/plugin.py index d5097fe..705f9c9 100644 --- a/plugin.py +++ b/plugin.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2015, PrgmrBill +# Copyright (c) 2015, butterscotchstallion # All rights reserved. # # diff --git a/test.py b/test.py index f38f323..174ce5b 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2015, PrgmrBill +# Copyright (c) 2015, butterscotchstallion # All rights reserved. # # From d1b02da1919644314cea82e3b0bdccbaed83cef8 Mon Sep 17 00:00:00 2001 From: kerozene Date: Mon, 26 Oct 2015 16:18:55 +1100 Subject: [PATCH 03/16] IMDB: Add ratings from Rotten Tomatoes and Metacritic --- plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 705f9c9..a3aa769 100644 --- a/plugin.py +++ b/plugin.py @@ -32,7 +32,7 @@ class IMDB(callbacks.Plugin): Queries OMDB api for query """ encoded_query = quote_plus(query) - omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json" % (encoded_query) + omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json&tomatoes=true" % (encoded_query) channel = msg.args[0] result = None headers = { @@ -59,6 +59,8 @@ class IMDB(callbacks.Plugin): imdb_template = imdb_template.replace("$country", response["Country"]) imdb_template = imdb_template.replace("$plot", response["Plot"]) imdb_template = imdb_template.replace("$imdbRating", response["imdbRating"]) + imdb_template = imdb_template.replace("$tomatoMeter", response["tomatoMeter"]) + imdb_template = imdb_template.replace("$metascore", response["Metascore"]) result = imdb_template else: From 9a2d1cec508940db9c3f7e28e9a525f9d57d4d3b Mon Sep 17 00:00:00 2001 From: kerozene Date: Mon, 26 Oct 2015 16:19:27 +1100 Subject: [PATCH 04/16] IMDB: Add IMDB URL --- config.py | 2 +- plugin.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 026788d..304daa0 100644 --- a/config.py +++ b/config.py @@ -28,7 +28,7 @@ def configure(advanced): IMDB = conf.registerPlugin('IMDB') conf.registerGlobalValue(IMDB, 'template', - registry.String("$title ($year, $country) - Rating: $imdbRating :: $plot", _("""Template for the output of a search query."""))) + registry.String("$title ($year, $country) - Rating: $imdbRating :: $plot :: http://imdb.com/title/$imdbID", _("""Template for the output of a search query."""))) conf.registerGlobalValue(IMDB, 'noResultsMessage', registry.String("No results for that query.", _("""This message is sent when there are no results"""))) diff --git a/plugin.py b/plugin.py index a3aa769..86440f8 100644 --- a/plugin.py +++ b/plugin.py @@ -58,6 +58,7 @@ class IMDB(callbacks.Plugin): imdb_template = imdb_template.replace("$year", response["Year"]) imdb_template = imdb_template.replace("$country", response["Country"]) imdb_template = imdb_template.replace("$plot", response["Plot"]) + imdb_template = imdb_template.replace("$imdbID", response["imdbID"]) imdb_template = imdb_template.replace("$imdbRating", response["imdbRating"]) imdb_template = imdb_template.replace("$tomatoMeter", response["tomatoMeter"]) imdb_template = imdb_template.replace("$metascore", response["Metascore"]) From 4cb50a5cd0570feb4bbf969fadb202e256532fdd Mon Sep 17 00:00:00 2001 From: kerozene Date: Mon, 26 Oct 2015 16:19:43 +1100 Subject: [PATCH 05/16] IMDB: Add director --- plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.py b/plugin.py index 86440f8..f06398a 100644 --- a/plugin.py +++ b/plugin.py @@ -57,6 +57,7 @@ class IMDB(callbacks.Plugin): imdb_template = imdb_template.replace("$title", response["Title"]) imdb_template = imdb_template.replace("$year", response["Year"]) imdb_template = imdb_template.replace("$country", response["Country"]) + imdb_template = imdb_template.replace("$director", response["Director"]) imdb_template = imdb_template.replace("$plot", response["Plot"]) imdb_template = imdb_template.replace("$imdbID", response["imdbID"]) imdb_template = imdb_template.replace("$imdbRating", response["imdbRating"]) From 7338be0acfe7c85a00363835725ab66d1bc380ed Mon Sep 17 00:00:00 2001 From: kerozene Date: Mon, 26 Oct 2015 16:28:24 +1100 Subject: [PATCH 06/16] IMDB: Add alternative template as config comment --- config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.py b/config.py index 304daa0..91a66f9 100644 --- a/config.py +++ b/config.py @@ -30,6 +30,9 @@ IMDB = conf.registerPlugin('IMDB') conf.registerGlobalValue(IMDB, 'template', registry.String("$title ($year, $country) - Rating: $imdbRating :: $plot :: http://imdb.com/title/$imdbID", _("""Template for the output of a search query."""))) +# alternative template: +# $title ($year - $director) :: [i:$imdbRating r:$tomatoMeter m:$metascore] $plot :: http://imdb.com/title/$imdbID + conf.registerGlobalValue(IMDB, 'noResultsMessage', registry.String("No results for that query.", _("""This message is sent when there are no results"""))) From 1ae4155666a2882f224d3a68c88bbc07d13b3e00 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 29 Jan 2017 15:56:01 +0100 Subject: [PATCH 07/16] IMDB: Fix import on Python 3 --- plugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index f06398a..0452c65 100644 --- a/plugin.py +++ b/plugin.py @@ -5,6 +5,7 @@ # ### +import sys import supybot.utils as utils from supybot.commands import * import supybot.plugins as plugins @@ -12,9 +13,13 @@ import supybot.ircutils as ircutils import supybot.ircmsgs as ircmsgs import supybot.callbacks as callbacks import requests -from urllib import quote_plus import json +if sys.version_info >= 3: + from urllib.parse import quote_plus +else: + from urllib import quote_plus + try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization('IMDB') From 163f5d8e03ef462d79ec2e165347e69f549dde06 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 29 Jan 2017 16:05:46 +0100 Subject: [PATCH 08/16] Fix previous commit --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 0452c65..0865976 100644 --- a/plugin.py +++ b/plugin.py @@ -15,7 +15,7 @@ import supybot.callbacks as callbacks import requests import json -if sys.version_info >= 3: +if sys.version_info[0] >= 3: from urllib.parse import quote_plus else: from urllib import quote_plus From 6c4076296a11289df9639aed13d3864f746aa0d2 Mon Sep 17 00:00:00 2001 From: Bogdan Ilisei Date: Fri, 24 Feb 2017 20:34:59 +0200 Subject: [PATCH 09/16] Fixes unicode chars in the template string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Working emojis 🔥 --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index f06398a..e208322 100644 --- a/plugin.py +++ b/plugin.py @@ -53,7 +53,7 @@ class IMDB(callbacks.Plugin): if not_found or unknown_error: self.log.info("IMDB: OMDB error for %s" % (omdb_url)) else: - imdb_template = self.registryValue("template") + imdb_template = self.registryValue("template").decode("utf-8") imdb_template = imdb_template.replace("$title", response["Title"]) imdb_template = imdb_template.replace("$year", response["Year"]) imdb_template = imdb_template.replace("$country", response["Country"]) From f2779ffecd172c12934bb1ef27f286da57ab2eac Mon Sep 17 00:00:00 2001 From: Bogdan Ilisei Date: Fri, 24 Feb 2017 21:14:27 +0200 Subject: [PATCH 10/16] Added $released for the release date --- plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.py b/plugin.py index f06398a..07b049c 100644 --- a/plugin.py +++ b/plugin.py @@ -63,6 +63,7 @@ class IMDB(callbacks.Plugin): imdb_template = imdb_template.replace("$imdbRating", response["imdbRating"]) imdb_template = imdb_template.replace("$tomatoMeter", response["tomatoMeter"]) imdb_template = imdb_template.replace("$metascore", response["Metascore"]) + imdb_template = imdb_template.replace("$released",response["Released"]) result = imdb_template else: From 1a005011c5a1ab3fcfc9db8d8a6d524532ec21e3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 15 Apr 2017 20:01:54 +0200 Subject: [PATCH 11/16] Fix Python 3 support It was broken by e2da8d0635fe880443b33771c7abaa1d9fb84d1a --- plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 16c7c37..9e47f83 100644 --- a/plugin.py +++ b/plugin.py @@ -58,7 +58,9 @@ class IMDB(callbacks.Plugin): if not_found or unknown_error: self.log.info("IMDB: OMDB error for %s" % (omdb_url)) else: - imdb_template = self.registryValue("template").decode("utf-8") + imdb_template = self.registryValue("template") + if sys.version_info[0] < 3: + imdb_template = imdb_template.decode("utf-8") imdb_template = imdb_template.replace("$title", response["Title"]) imdb_template = imdb_template.replace("$year", response["Year"]) imdb_template = imdb_template.replace("$country", response["Country"]) From e2177c5d8fc984d61e62e50464320aa17896f259 Mon Sep 17 00:00:00 2001 From: stevewillows <1559567+stevewillows@users.noreply.github.com> Date: Mon, 2 Apr 2018 19:28:58 -0700 Subject: [PATCH 12/16] API to URL (xxxxxxxx), date search Sign up for an API at omdbapi.com and replace xxxxxxxx in the URL. Users can also search title and year or just title. --- plugin.py | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/plugin.py b/plugin.py index 9e47f83..c78ba8f 100644 --- a/plugin.py +++ b/plugin.py @@ -36,25 +36,33 @@ class IMDB(callbacks.Plugin): """ Queries OMDB api for query """ - encoded_query = quote_plus(query) - omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json&tomatoes=true" % (encoded_query) + + if query[-4:].isdigit(): + encoded_query = quote_plus(query[0:-4]) + encoded_query_year = quote_plus(query[-4:]) + omdb_url = "http://www.omdbapi.com/?t=%s&y=%s&plot=short&r=json&tomatoes=true&apikey=xxxxxxxx" % (encoded_query, encoded_query_year) + self.log.info("IMDB: Check for %s year %s" % (query[0:-4], query[-4:])) + else: + encoded_query = quote_plus(query) + omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json&tomatoes=true&apikey=xxxxxxxx" % (encoded_query) + channel = msg.args[0] result = None headers = { "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.60 Safari/537.36" } - + self.log.info("IMDB: requesting %s" % omdb_url) - + try: request = requests.get(omdb_url, timeout=10, headers=headers) - + if request.status_code == requests.codes.ok: response = json.loads(request.text) - + not_found = "Error" in response unknown_error = response["Response"] != "True" - + if not_found or unknown_error: self.log.info("IMDB: OMDB error for %s" % (omdb_url)) else: @@ -71,11 +79,15 @@ class IMDB(callbacks.Plugin): imdb_template = imdb_template.replace("$tomatoMeter", response["tomatoMeter"]) imdb_template = imdb_template.replace("$metascore", response["Metascore"]) imdb_template = imdb_template.replace("$released",response["Released"]) - + imdb_template = imdb_template.replace("$genre",response["Genre"]) + imdb_template = imdb_template.replace("$released",response["Released"]) + imdb_template = imdb_template.replace("$awards",response["Awards"]) + imdb_template = imdb_template.replace("$actors",response["Actors"]) + result = imdb_template else: - self.log.error("IMDB OMDB API %s - %s" % (request.status_code, request.text)) - + self.log.error("IMDB OMDB API %s - %s" % (request.status_code, request.text)) + except requests.exceptions.Timeout as e: self.log.error("IMDB Timeout: %s" % (str(e))) except requests.exceptions.ConnectionError as e: @@ -87,9 +99,9 @@ class IMDB(callbacks.Plugin): irc.sendMsg(ircmsgs.privmsg(channel, result)) else: irc.error(self.registryValue("noResultsMessage")) - + imdb = wrap(imdb, ['text']) - + Class = IMDB From e1d636a3af99616bc775a87a552323bb4b461f8d Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Fri, 8 Mar 2019 23:26:42 -0500 Subject: [PATCH 13/16] apikey. $rated $writer $runtime. reply over pm --- plugin.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index c78ba8f..a79a56d 100644 --- a/plugin.py +++ b/plugin.py @@ -36,15 +36,15 @@ class IMDB(callbacks.Plugin): """ Queries OMDB api for query """ - + apikey = self.registryValue('omdbAPI') if query[-4:].isdigit(): encoded_query = quote_plus(query[0:-4]) encoded_query_year = quote_plus(query[-4:]) - omdb_url = "http://www.omdbapi.com/?t=%s&y=%s&plot=short&r=json&tomatoes=true&apikey=xxxxxxxx" % (encoded_query, encoded_query_year) + omdb_url = "http://www.omdbapi.com/?t=%s&y=%s&plot=short&r=json&tomatoes=true&apikey=%s" % (encoded_query, encoded_query_year, apikey) self.log.info("IMDB: Check for %s year %s" % (query[0:-4], query[-4:])) else: encoded_query = quote_plus(query) - omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json&tomatoes=true&apikey=xxxxxxxx" % (encoded_query) + omdb_url = "http://www.omdbapi.com/?t=%s&y=&plot=short&r=json&tomatoes=true&apikey=%s" % (encoded_query, apikey) channel = msg.args[0] result = None @@ -83,6 +83,9 @@ class IMDB(callbacks.Plugin): imdb_template = imdb_template.replace("$released",response["Released"]) imdb_template = imdb_template.replace("$awards",response["Awards"]) imdb_template = imdb_template.replace("$actors",response["Actors"]) + imdb_template = imdb_template.replace("$rated",response["Rated"]) + imdb_template = imdb_template.replace("$runtime",response["Runtime"]) + imdb_template = imdb_template.replace("$writer",response["Writer"]) result = imdb_template else: @@ -96,7 +99,7 @@ class IMDB(callbacks.Plugin): self.log.error("IMDB HTTPError: %s" % (str(e))) finally: if result is not None: - irc.sendMsg(ircmsgs.privmsg(channel, result)) + irc.reply(result) else: irc.error(self.registryValue("noResultsMessage")) From 15a191910c9678bb98e333d326324d5f802936e0 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Fri, 8 Mar 2019 23:27:38 -0500 Subject: [PATCH 14/16] omdbAPI config. new template --- config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index 91a66f9..3d6a4ef 100644 --- a/config.py +++ b/config.py @@ -28,12 +28,14 @@ def configure(advanced): IMDB = conf.registerPlugin('IMDB') conf.registerGlobalValue(IMDB, 'template', - registry.String("$title ($year, $country) - Rating: $imdbRating :: $plot :: http://imdb.com/title/$imdbID", _("""Template for the output of a search query."""))) + registry.String("$title ($year, $country, [$rated], $genre, $runtime) | IMDB: $imdbRating MC: $metascore% | $plot | Director: $director | Writer: $writer | Actors: $actors | http://imdb.com/title/$imdbID", _("""Template for the output of a search query."""))) # alternative template: # $title ($year - $director) :: [i:$imdbRating r:$tomatoMeter m:$metascore] $plot :: http://imdb.com/title/$imdbID conf.registerGlobalValue(IMDB, 'noResultsMessage', - registry.String("No results for that query.", _("""This message is sent when there are no results"""))) - + registry.String("No results for that query.", _("""This message is sent when there are no results"""))) +conf.registerGlobalValue(IMDB, 'omdbAPI', + registry.String('', _("""OMDB API Key"""))) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: From 0346d85321b6e019c16549ac8451d34dad4f5a52 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Fri, 8 Mar 2019 23:46:52 -0500 Subject: [PATCH 15/16] Update config.py --- config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index 3d6a4ef..c783eea 100644 --- a/config.py +++ b/config.py @@ -28,14 +28,14 @@ def configure(advanced): IMDB = conf.registerPlugin('IMDB') conf.registerGlobalValue(IMDB, 'template', - registry.String("$title ($year, $country, [$rated], $genre, $runtime) | IMDB: $imdbRating MC: $metascore% | $plot | Director: $director | Writer: $writer | Actors: $actors | http://imdb.com/title/$imdbID", _("""Template for the output of a search query."""))) + registry.String("$title ($year, $country, [$rated], $genre, $runtime) | IMDB: $imdbRating MC: $metascore% | $plot | Director: $director | Writer: $writer | Actors: $actors | http://imdb.com/title/$imdbID", _("""Template for the output of a search query."""))) # alternative template: # $title ($year - $director) :: [i:$imdbRating r:$tomatoMeter m:$metascore] $plot :: http://imdb.com/title/$imdbID conf.registerGlobalValue(IMDB, 'noResultsMessage', - registry.String("No results for that query.", _("""This message is sent when there are no results"""))) + registry.String("No results for that query.", _("""This message is sent when there are no results"""))) conf.registerGlobalValue(IMDB, 'omdbAPI', - registry.String('', _("""OMDB API Key"""))) + registry.String('', _("""OMDB API Key"""))) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: From 7a4fab539f746f961a360f57012b771e3f70bafb Mon Sep 17 00:00:00 2001 From: oddluck <39967334+oddluck@users.noreply.github.com> Date: Sat, 9 Mar 2019 01:34:06 -0500 Subject: [PATCH 16/16] remove --- local/__init__.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 local/__init__.py diff --git a/local/__init__.py b/local/__init__.py deleted file mode 100644 index e86e97b..0000000 --- a/local/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Stub so local is a module, used for third-party modules