diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 9d81f9c..0680b86 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -133,6 +133,14 @@ msgctxt "#30723" msgid "The Widevine device file must have a '.wvd' extension." msgstr "" +msgctxt "#30724" +msgid "{title} added to My List" +msgstr "" + +msgctxt "#30725" +msgid "{title} removed from My List" +msgstr "" + ### SETTINGS msgctxt "#30800" diff --git a/resources/language/resource.language.nl_nl/strings.po b/resources/language/resource.language.nl_nl/strings.po index 82b181e..7f32950 100644 --- a/resources/language/resource.language.nl_nl/strings.po +++ b/resources/language/resource.language.nl_nl/strings.po @@ -133,6 +133,14 @@ msgctxt "#30723" msgid "The Widevine device file must have a '.wvd' extension." msgstr "Het Widevine-apparaatbestand moet een '.wvd' extensie hebben." +msgctxt "#30724" +msgid "{title} added to My List" +msgstr "{title} toegevoegd aan Mijn Lijst" + +msgctxt "#30725" +msgid "{title} removed from My List" +msgstr "{title} verwijderd uit Mijn Lijst" + ### SETTINGS msgctxt "#30800" diff --git a/resources/lib/addon.py b/resources/lib/addon.py index ce4fb37..90d98b4 100644 --- a/resources/lib/addon.py +++ b/resources/lib/addon.py @@ -97,18 +97,18 @@ def show_mylist(): Catalog().show_mylist() -@routing.route('/mylist/add/') -def mylist_add(uuid): +@routing.route('/mylist/add//') +def mylist_add(uuid, title): """ Add a program to My List """ from resources.lib.modules.catalog import Catalog - Catalog().mylist_add(uuid) + Catalog().mylist_add(uuid, title) -@routing.route('/mylist/del/<uuid>') -def mylist_del(uuid): +@routing.route('/mylist/del/<uuid>/<title>') +def mylist_del(uuid, title): """ Remove a program from My List """ from resources.lib.modules.catalog import Catalog - Catalog().mylist_del(uuid) + Catalog().mylist_del(uuid, title) @routing.route('/continue') diff --git a/resources/lib/modules/catalog.py b/resources/lib/modules/catalog.py index 86848dd..2738795 100644 --- a/resources/lib/modules/catalog.py +++ b/resources/lib/modules/catalog.py @@ -4,6 +4,7 @@ from __future__ import absolute_import, division, unicode_literals import logging +from urllib.parse import unquote_plus from resources.lib import kodiutils from resources.lib.goplay.auth import AuthApi @@ -180,7 +181,7 @@ def show_mylist(self): # Used for A-Z listing or when movies and episodes are mixed. kodiutils.show_listing(listing, 30011, content='tvshows', sort='title') - def mylist_add(self, uuid): + def mylist_add(self, uuid, title): """ Add a program to My List """ if not uuid: kodiutils.end_of_directory() @@ -188,9 +189,10 @@ def mylist_add(self, uuid): self._api.mylist_add(uuid) + kodiutils.notification(message=kodiutils.localize(30724, title=unquote_plus(title))) # We need to ensure forward slashes are quoted kodiutils.end_of_directory() - def mylist_del(self, uuid): + def mylist_del(self, uuid, title): """ Remove a program from My List """ if not uuid: kodiutils.end_of_directory() @@ -198,6 +200,7 @@ def mylist_del(self, uuid): self._api.mylist_del(uuid) + kodiutils.notification(message=kodiutils.localize(30725, title=unquote_plus(title))) # We need to ensure forward slashes are quoted kodiutils.end_of_directory() def continue_watching(self, index=0): diff --git a/resources/lib/modules/menu.py b/resources/lib/modules/menu.py index 289631a..6930515 100644 --- a/resources/lib/modules/menu.py +++ b/resources/lib/modules/menu.py @@ -4,17 +4,13 @@ from __future__ import absolute_import, division, unicode_literals import logging +from urllib.parse import quote, quote_plus from resources.lib import kodiutils from resources.lib.goplay import STREAM_DICT from resources.lib.goplay.content import Episode, Program from resources.lib.kodiutils import TitleItem -try: # Python 3 - from urllib.parse import quote -except ImportError: # Python 2 - from urllib import quote - _LOGGER = logging.getLogger(__name__) @@ -147,13 +143,13 @@ def generate_titleitem(item): context_menu.append(( kodiutils.localize(30101), # Remove from My List 'Container.Update(%s)' % - kodiutils.url_for('mylist_del', uuid=item.uuid) + kodiutils.url_for('mylist_del', uuid=item.uuid, title=quote_plus(item.title)) )) else: context_menu.append(( kodiutils.localize(30100), # Add to My List 'Container.Update(%s)' % - kodiutils.url_for('mylist_add', uuid=item.uuid) + kodiutils.url_for('mylist_add', uuid=item.uuid, title=quote_plus(item.title)) )) context_menu.append((