diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2009-06-12 00:21:01 +0200 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2009-06-12 00:21:01 +0200 |
| commit | 1a2b0a4379ee3e9d16108c52abdadc9bb85675c1 (patch) | |
| tree | 3a4a5fbf6f9fc0fa50c7821f59b07479f1417d87 /lib/python/Components | |
| parent | 427f94625feece0bd9e55dddf9c37b1fa9969cb3 (diff) | |
| download | enigma2-1a2b0a4379ee3e9d16108c52abdadc9bb85675c1.tar.gz enigma2-1a2b0a4379ee3e9d16108c52abdadc9bb85675c1.zip | |
patch by Dr.Best - allow using filesize of movie in converter
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Converter/MovieInfo.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py index be28dcce..635cedc4 100644 --- a/lib/python/Components/Converter/MovieInfo.py +++ b/lib/python/Components/Converter/MovieInfo.py @@ -7,6 +7,7 @@ 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 + MOVIE_REC_FILESIZE = 3 # filesize of recording def __init__(self, type): if type == "ShortDescription": @@ -15,8 +16,10 @@ class MovieInfo(Converter, object): self.type = self.MOVIE_META_DESCRIPTION elif type == "RecordServiceName": self.type = self.MOVIE_REC_SERVICE_NAME + elif type == "FileSize": + self.type = self.MOVIE_REC_FILESIZE else: - raise ElementError("'%s' is not <ShortDescription|MetaDescription|RecordServiceName> for MovieInfo converter" % type) + raise ElementError("'%s' is not <ShortDescription|MetaDescription|RecordServiceName|FileSize> for MovieInfo converter" % type) Converter.__init__(self, type) @cached @@ -37,6 +40,8 @@ class MovieInfo(Converter, object): elif self.type == self.MOVIE_REC_SERVICE_NAME: rec_ref_str = info.getInfoString(service, iServiceInformation.sServiceref) return ServiceReference(rec_ref_str).getServiceName() + elif self.type == self.MOVIE_REC_FILESIZE: + return "%d MB" % (info.getInfo(service, iServiceInformation.sFileSize) / (1024*1024)) return "" text = property(getText) |
