From aa09aef4d85f4d103732adcc669359269b918de4 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 15 Jun 2009 21:49:54 -0400 Subject: [PATCH] A small bit of redundant code. --- plugins/video/video.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/video/video.py b/plugins/video/video.py index bbd9fcf..5097de8 100644 --- a/plugins/video/video.py +++ b/plugins/video/video.py @@ -69,6 +69,8 @@ class Video(Plugin): if 'Format' in query: mime = query['Format'][0] + is_tivo_push = (mime == 'video/mpeg' and is_tivo_file) + compatible = transcode.tivo_compatible(path, tsn, mime)[0] offset = handler.headers.getheader('Range') @@ -79,7 +81,7 @@ class Video(Plugin): handler.send_header('Content-Type', mime) if offset: - if ((compatible and ((mime == 'video/mpeg' and is_tivo_file) + if ((compatible and (is_tivo_push or offset >= os.stat(path).st_size)) or (not compatible and not transcode.is_resumable(path, offset))): handler.send_header('Connection', 'close') @@ -97,7 +99,7 @@ class Video(Plugin): if mime == 'video/mp4': qtfaststart.fast_start(f, handler.wfile, offset) else: - if mime == 'video/mpeg' and is_tivo_file: + if is_tivo_push: tivodecode_path = config.get_bin('tivodecode') tivo_mak = config.get_server('tivo_mak') if tivodecode_path and tivo_mak: -- 2.11.4.GIT