From 1a63a69b6d42760d4b022d4c0789b2f255250d26 Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Thu, 22 Nov 2007 00:53:42 -0600 Subject: [PATCH] Looks like the titles are working now --- plugins/video/templates/TvBus.tmpl | 10 ++++++---- plugins/video/templates/container.tmpl | 14 +++++++------- plugins/video/video.py | 17 ++++++++++++----- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/plugins/video/templates/TvBus.tmpl b/plugins/video/templates/TvBus.tmpl index 9919256..5eb5c4d 100644 --- a/plugins/video/templates/TvBus.tmpl +++ b/plugins/video/templates/TvBus.tmpl @@ -1,6 +1,6 @@ - PT00M + $video.iso_durarion @@ -27,6 +27,7 @@ #end for $video.episodeNumber + $video.title #for $element in $video.vExecProducer $element @@ -64,7 +65,7 @@ $video.seriesTitle $video.showType[0] - $video.title + $video.seriesTitle #for $element in $video.vWriter $element @@ -106,6 +107,7 @@ #end for $video.episodeNumber + $video.title #for $element in $video.vExecProducer $element @@ -140,10 +142,10 @@ $element #end for - $video.seriesTitle + $video.title $video.showType[0] - $video.title + $video.seriesTitle #for $element in $video.vWriter $element diff --git a/plugins/video/templates/container.tmpl b/plugins/video/templates/container.tmpl index 368154c..67f9142 100644 --- a/plugins/video/templates/container.tmpl +++ b/plugins/video/templates/container.tmpl @@ -26,16 +26,16 @@ #else
- $video.title + $video.seriesTitle video/x-tivo-mpeg video/x-ms-wmv $video.size - $video.duration - $escape($video.description) - $escape($video.episodeTitle) - $escape($video.sourceChannel) - $escape($video.sourceStation) - $video.seriesId + $video.duration + $escape($video.description) + $escape($video.title) + $escape($video.sourceChannel) + $escape($video.sourceStation) + $video.seriesId
diff --git a/plugins/video/video.py b/plugins/video/video.py index bf1324c..57eb04f 100644 --- a/plugins/video/video.py +++ b/plugins/video/video.py @@ -85,13 +85,22 @@ class Video(Plugin): metadata = {} + base_path, title = os.path.split(full_path) + metadata['title'] = '.'.join(title.split('.')[:-1]) + metadata['seriesTitle'] = os.path.split(base_path)[1] + metadata.update( self.__getMetadateFromTxt(full_path) ) metadata['size'] = self.__est_size(full_path) metadata['duration'] = self.__duration(full_path) duration = timedelta(milliseconds = metadata['duration']) - metadata['iso_durarion'] = 'P' + str(duration.days) + 'DT' + str(duration.seconds) + 'S' + + min = duration.seconds / 60 + sec = duration.seconds % 60 + hours = min / 60 + min = min % 60 + metadata['iso_durarion'] = 'P' + str(duration.days) + 'DT' + str(hours) + 'H' + str(min) + 'M' + str(sec) + 'S' return metadata @@ -148,8 +157,6 @@ class Video(Plugin): file_info = VideoDetails() - file_info['seriesTitle'] = os.path.split(path)[-1] - file_info['title'] = '.'.join(file.split('.')[:-1]) file_info.update(self.__metadata(file_path)) print file_info @@ -205,9 +212,9 @@ class VideoDetails(DictMixin): if key in defaults: return defaults[key] elif key.startswith('v'): - return ['Default'] + return [key + '1', key + '2'] else: - return 'Default' + return key # Parse a bitrate using the SI/IEEE suffix values as if by ffmpeg -- 2.11.4.GIT