From 5e0d91a196bfe872d04d676e5f6c2d5940786be0 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Mon, 6 Aug 2007 22:39:50 +0000 Subject: add possibility to select between different list styles via context menu add possibility to sort the movielist by record time or alphanumeric add possibility to show detailed information about current selected movie thx to ralfk --- lib/python/Components/Converter/Makefile.am | 2 +- lib/python/Components/Converter/MovieInfo.py | 42 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 lib/python/Components/Converter/MovieInfo.py (limited to 'lib/python/Components/Converter') diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am index 81dfdd4d..657010db 100644 --- a/lib/python/Components/Converter/Makefile.am +++ b/lib/python/Components/Converter/Makefile.am @@ -4,4 +4,4 @@ install_PYTHON = \ __init__.py ClockToText.py Converter.py EventName.py StaticText.py EventTime.py \ Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \ ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py \ - StaticMultiList.py ServiceTime.py + StaticMultiList.py ServiceTime.py MovieInfo.py diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py new file mode 100644 index 00000000..068d24d3 --- /dev/null +++ b/lib/python/Components/Converter/MovieInfo.py @@ -0,0 +1,42 @@ +from Components.Converter.Converter import Converter +from Components.Element import cached +from enigma import iServiceInformation +from ServiceReference import ServiceReference + +class MovieInfo(Converter, object): + MOVIE_SHORT_DESCRIPTION = 0 # meta description when available.. when not .eit short description + MOVIE_META_DESCRIPTION = 1 # just meta description when available + MOVIE_REC_SERVICE_NAME = 2 # name of recording service + + def __init__(self, type): + if type == "ShortDescription": + self.type = self.MOVIE_SHORT_DESCRIPTION + elif type == "MetaDescription": + self.type = self.MOVIE_META_DESCRIPTION + elif type == "RecordServiceName": + self.type = self.MOVIE_REC_SERVICE_NAME + else: + raise str("'%s' is not for MovieInfo converter" % type) + Converter.__init__(self, type) + + @cached + def getText(self): + service = self.source.service + info = self.source.info + if info and service: + if self.type == self.MOVIE_SHORT_DESCRIPTION: + event = self.source.event + if event: + descr = info.getInfoString(service, iServiceInformation.sDescription) + if descr == "": + return event.getShortDescription() + else: + return descr + elif self.type == self.MOVIE_META_DESCRIPTION: + return info.getInfoString(service, iServiceInformation.sDescription) + elif self.type == self.MOVIE_REC_SERVICE_NAME: + rec_ref_str = info.getInfoString(service, iServiceInformation.sServiceref) + return ServiceReference(rec_ref_str).getServiceName() + return "" + + text = property(getText) -- cgit v1.2.3