From 11291a93aecc5000619e3182fe93fb77909a7b7f Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Mon, 19 Nov 2007 22:03:53 -0600 Subject: [PATCH] Kinda working support for TvBus metadata Need to find out that works in TvBus.tmpl And add all the fields to the text file --- plugins/video/templates/TvBus.tmpl | 79 ++++++++++++++++++++++++++++++++++ plugins/video/templates/container.tmpl | 5 +++ plugins/video/video.py | 14 ++++++ 3 files changed, 98 insertions(+) create mode 100644 plugins/video/templates/TvBus.tmpl diff --git a/plugins/video/templates/TvBus.tmpl b/plugins/video/templates/TvBus.tmpl new file mode 100644 index 0000000..eab3109 --- /dev/null +++ b/plugins/video/templates/TvBus.tmpl @@ -0,0 +1,79 @@ + + + PT00M + + + + + PT00M + + + + + COLOR + + 5 + + + + + false + 2006-01-23T04:39:43Z + + + false + + + + SERIES + + + + + 0 + 0 + + + PG + + + + HIGH + + + + PT00M + + + + + COLORIZED + + + 0 + + + + + false + 2006-01-23T04:39:43Z + + + false + + + + SERIES + parkrun1920_12mbps + + + + 0 + 0 + + + PG + + 2008-01-23T04:39:43Z + 2008-01-23T04:39:43Z + diff --git a/plugins/video/templates/container.tmpl b/plugins/video/templates/container.tmpl index 2dcfb26..ab0f943 100644 --- a/plugins/video/templates/container.tmpl +++ b/plugins/video/templates/container.tmpl @@ -48,6 +48,11 @@ No urn:tivo:image:save-until-i-delete-recording + + text/xml + No + /TiVoConnect?Command=TVBusQuery&Container=$escape($name)&File=$quote($video.name) + #end if diff --git a/plugins/video/video.py b/plugins/video/video.py index b5927b8..c98506e 100644 --- a/plugins/video/video.py +++ b/plugins/video/video.py @@ -126,6 +126,20 @@ class Video(Plugin): t.escape = escape handler.wfile.write(t) + def TVBusQuery(self, handler, query): + + file = query['File'][0] + path = self.get_local_path(handler, query) + file_path = os.path.join(path, file) + + file_info = self.__metadata(file_path) + + handler.send_response(200) + handler.end_headers() + t = Template(file=os.path.join(SCRIPTDIR,'templates', 'TvBus.tmpl')) + t.video = file_info + handler.wfile.write(t) + # Parse a bitrate using the SI/IEEE suffix values as if by ffmpeg # For example, 2K==2000, 2Ki==2048, 2MB==16000000, 2MiB==16777216 -- 2.11.4.GIT