diff --git a/CONTROL/control b/CONTROL/control index 4a32198..8c10f1b 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Description: TMDBCockpit Maintainer: dream-alpha Package: enigma2-plugin-extensions-tmdbcockpit -Version: 8.1.5 +Version: 8.2.2 Architecture: all Depends: python-requests Conflicts: enigma2-plugin-extensions-tmdb diff --git a/src/Json.py b/src/Json.py index 140a591..9dbfc60 100644 --- a/src/Json.py +++ b/src/Json.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- coding: utf-8 -*- +# coding=utf-8 # # Copyright (C) 2018-2024 by dream-alpha # @@ -20,7 +20,6 @@ import six -# from .__init__ import _ from .Debug import logger from .Utils import checkText diff --git a/src/ScreenMain.py b/src/ScreenMain.py index 3827970..48b580d 100644 --- a/src/ScreenMain.py +++ b/src/ScreenMain.py @@ -67,7 +67,7 @@ def __init__(self, session, service, mode): self.result = [] self['searchinfo'] = Label() - self['key_red'] = Label(_("Exit")) + self['key_red'] = Label(_("Cancel")) self['key_green'] = Label(_("Details")) self['key_yellow'] = Label(_("Edit search")) self['key_blue'] = Label(_("more ...")) @@ -84,7 +84,7 @@ def __init__(self, session, service, mode): "cancel": (self.exit, _("Exit")), "nextBouquet": (self.nextBouquet, _("Details down")), "prevBouquet": (self.prevBouquet, _("Details up")), - "red": (self.exit, _("Exit")), + "red": (self.exit, _("Cancel")), "green": (self.ok, _("Show details")), "yellow": (self.searchString, _("Edit search")), "blue": (self.menu, _("more ...")), @@ -212,18 +212,24 @@ def ok(self): cover_url = current[3] backdrop_url = current[4] if media in ["movie", "tv"]: - self.session.openWithCallback(self.callbackScreenMovie, ScreenMovie, title, media, cover_url, ident, self.service_path, backdrop_url) + self.session.openWithCallback(self.screenMovieCallback, ScreenMovie, title, media, cover_url, ident, self.service_path, backdrop_url) elif media == "person": - self.session.open(ScreenPerson, title, ident, "") + self.session.openWithCallback(self.screenPersonCallback, ScreenPerson, title, ident, "") else: logger.debug("unsupported media: %s", media) - def callbackScreenMovie(self, files_saved): + def screenMovieCallback(self, do_exit, files_saved): logger.info("files_saved: %s", files_saved) self.files_saved = files_saved - if self.count == 1: + if do_exit: + self.exit() + elif self.count == 1: self.showPictures() + def screenPersonCallback(self, do_exit): + if do_exit: + self.exit() + def menu(self): logger.info("...") options = [ diff --git a/src/ScreenMovie.py b/src/ScreenMovie.py index 7afb721..06c3b49 100644 --- a/src/ScreenMovie.py +++ b/src/ScreenMovie.py @@ -33,6 +33,7 @@ from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Tools.LoadPixmap import LoadPixmap +from Tools.BoundFunction import boundFunction from .__init__ import _ from .ScreenConfig import ScreenConfig from .ScreenPeople import ScreenPeople @@ -101,7 +102,7 @@ def __init__(self, session, movie, media, cover_url, ident, service_path, backdr "studio": (_("Studio:"), "-"), } - self["key_red"] = Label(_("Exit")) + self["key_red"] = Label(_("Cancel")) self["key_green"] = Label(_("Crew")) self["key_yellow"] = Label(_("Seasons")) if self.media == "tv" else Label("") self["key_blue"] = Label(_("more ...")) if self.service_path else Label("") @@ -118,12 +119,12 @@ def __init__(self, session, movie, media, cover_url, ident, service_path, backdr "TMDBActions", { "ok": (self.green, _("Crew")), - "cancel": (self.exit, _("Exit")), + "cancel": (boundFunction(self.exit, True), _("Exit")), "up": (self.fulldescription.pageUp, _("Selection up")), "down": (self.fulldescription.pageDown, _("Selection down")), "left": (self.fulldescription.pageUp, _("Page up")), "right": (self.fulldescription.pageDown, _("Page down")), - "red": (self.exit, _("Exit")), + "red": (boundFunction(self.exit, False), _("Cancel")), "green": (self.green, _("Crew")), "yellow": (self.yellow, _("Seasons")), "blue": (self.showMenu, _("more ...")), @@ -230,8 +231,10 @@ def yellow(self): elif len(videolist) == 1: self.videolistCallback(videolist[0]) - def screenSeasonCallback(self, files_saved): + def screenSeasonCallback(self, do_exit, files_saved): self.files_saved = files_saved + if do_exit: + self.exit(True) def videolistCallback(self, ret): ret = ret and ret[1] @@ -239,7 +242,11 @@ def videolistCallback(self, ret): self.session.open(MoviePlayer, eServiceReference(ret), streamMode=True, askBeforeLeaving=False) def green(self): - self.session.open(ScreenPeople, self.movie, self.ident , self.media, self.cover_url, self.backdrop_url) + self.session.openWithCallback(self.screenPeopleCallback, ScreenPeople, self.movie, self.ident , self.media, self.cover_url, self.backdrop_url) - def exit(self): - self.close(self.files_saved) + def screenPeopleCallback(self, do_exit): + if do_exit: + self.exit(True) + + def exit(self, do_exit): + self.close(do_exit, self.files_saved) diff --git a/src/ScreenPeople.py b/src/ScreenPeople.py index 0f63b0d..b3d135d 100644 --- a/src/ScreenPeople.py +++ b/src/ScreenPeople.py @@ -24,6 +24,7 @@ from Components.Pixmap import Pixmap from Screens.HelpMenu import HelpableScreen from Screens.Screen import Screen +from Tools.BoundFunction import boundFunction from .__init__ import _ from .List import List from .ScreenConfig import ScreenConfig @@ -49,7 +50,7 @@ def __init__(self, session, movie, ident, media, cover_url, backdrop_url): self.result = [] self['searchinfo'] = Label() - self['key_red'] = Label(_("Exit")) + self['key_red'] = Label(_("Cancel")) self['key_green'] = Label(_("Details")) self["key_yellow"] = Label() self['key_blue'] = Label() @@ -63,12 +64,12 @@ def __init__(self, session, movie, ident, media, cover_url, backdrop_url): "TMDBActions", { "ok": (self.ok, _("Show details")), - "cancel": (self.exit, _("Exit")), + "cancel": (boundFunction(self.exit, True), _("Exit")), "up": (self.list.moveUp, _("Selection up")), "down": (self.list.moveDown, _("Selection down")), "right": (self.list.pageDown, _("Page down")), "left": (self.list.pageUp, _("Page down")), - "red": (self.exit, _("Exit")), + "red": (boundFunction(self.exit, False), _("Cancel")), "green": (self.ok, _("Show details")), "menu": (self.setup, _("Setup")) }, @@ -113,12 +114,16 @@ def ok(self): name = current[1] cover_ident = current[3] if cover_ident: - self.session.open(ScreenPerson, name, cover_ident, self.ident) + self.session.openWithCallback(self.screenPersonCallback, ScreenPerson, name, cover_ident, self.ident) + + def screenPersonCallback(self, do_exit): + if do_exit: + self.exit(True) def setup(self): self.session.open(ScreenConfig) - def exit(self): + def exit(self, do_exit): DelayTimer.stopAll() self["list"].onSelectionChanged.remove(self.onSelectionChanged) - self.close() + self.close(do_exit) diff --git a/src/ScreenPerson.py b/src/ScreenPerson.py index 8b77cf6..f8dc16f 100644 --- a/src/ScreenPerson.py +++ b/src/ScreenPerson.py @@ -26,6 +26,7 @@ from Components.ScrollLabel import ScrollLabel from Screens.HelpMenu import HelpableScreen from Screens.Screen import Screen +from Tools.BoundFunction import boundFunction from .__init__ import _ from .Picture import Picture from .Debug import logger @@ -50,7 +51,7 @@ def __init__(self, session, person, cover_ident, backdrop_ident): self['cover'] = Pixmap() self['backdrop'] = Pixmap() - self['key_red'] = Label(_("Exit")) + self['key_red'] = Label(_("Cancel")) self['key_green'] = Label() self['key_yellow'] = Label() self['key_blue'] = Label() @@ -60,12 +61,12 @@ def __init__(self, session, person, cover_ident, backdrop_ident): self, "TMDBActions", { - "cancel": (self.exit, _("Exit")), + "cancel": (boundFunction(self.exit, True), _("Exit")), "up": (self.fulldescription.pageUp, _("Selection up")), "down": (self.fulldescription.pageDown, _("Selection down")), "left": (self.fulldescription.pageUp, _("Page up")), "right": (self.fulldescription.pageDown, _("Page down")), - "red": (self.exit, _("Exit")), + "red": (boundFunction(self.exit, False), _("Cancel")), "menu": (self.setup, _("Setup")), }, -1, @@ -98,13 +99,14 @@ def gotData(self, result): + result["gender"] + "\n" \ + result["also_known_as"] + "\n" \ + _("Popularity") + ": " + result["popularity"] + "\n\n" \ - + result["biography"] + "\n\n" \ - + _("Known for:") + "\n" \ - + result["movies"] + + result["biography"] + "\n\n" + if result["movies"]: + fulldescription += _("Known for:") + "\n" \ + + result["movies"] self["fulldescription"].setText(fulldescription) def setup(self): self.session.open(ScreenConfig) - def exit(self): - self.close() + def exit(self, do_exit): + self.close(do_exit) diff --git a/src/ScreenSeason.py b/src/ScreenSeason.py index 72a14a0..1f74f70 100644 --- a/src/ScreenSeason.py +++ b/src/ScreenSeason.py @@ -25,6 +25,7 @@ from Components.ScrollLabel import ScrollLabel from Screens.HelpMenu import HelpableScreen from Screens.Screen import Screen +from Tools.BoundFunction import boundFunction from .__init__ import _ from .List import List from .ScreenConfig import ScreenConfig @@ -51,7 +52,7 @@ def __init__(self, session, movie, ident, media, service_path): self.result = [] self['searchinfo'] = Label() self["overview"] = self.overview_label = ScrollLabel() - self['key_red'] = Label(_("Exit")) + self['key_red'] = Label(_("Cancel")) self['key_green'] = Label() self['key_yellow'] = Label() self["key_blue"] = Label(_("more ...")) if self.service_path else Label("") @@ -64,14 +65,14 @@ def __init__(self, session, movie, ident, media, service_path): self, "TMDBActions", { - "cancel": (self.exit, _("Exit")), + "cancel": (boundFunction(self.exit, True), _("Exit")), "up": (self.list.moveUp, _("Selection up")), "down": (self.list.moveDown, _("Selection down")), "nextBouquet": (self.overview_label.pageUp, _("Details down")), "prevBouquet": (self.overview_label.pageDown, _("Details up")), "right": (self.list.pageDown, _("Page down")), "left": (self.list.pageUp, _("Page down")), - "red": (self.exit, _("Exit")), + "red": (boundFunction(self.exit, False), _("Cancel")), "blue": (self.showMenu, _("more ...")), "menu": (self.setup, _("Setup")) }, @@ -120,7 +121,7 @@ def showInfo(self): def setup(self): self.session.open(ScreenConfig) - def exit(self): + def exit(self, do_exit): DelayTimer.stopAll() self["list"].onSelectionChanged.remove(self.onSelectionChanged) - self.close(self.files_saved) + self.close(do_exit, self.files_saved) diff --git a/src/Version.py b/src/Version.py index 9dfb55e..308ed25 100644 --- a/src/Version.py +++ b/src/Version.py @@ -21,6 +21,6 @@ PLUGIN = "TMDBCockpit" ID = "TMDB" -VERSION = "8.1.5" +VERSION = "8.2.2" COPYRIGHT = "2018-2024 by dream-alpha" LICENSE = "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version."