From 853a25f5b72ba119899baf8b1b50532e2900cfa9 Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Thu, 14 Aug 2008 07:35:31 +0000 Subject: [PATCH] add autoplay detection for .ts movies --- lib/python/Components/Scanner.py | 4 +++- lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/Scanner.py b/lib/python/Components/Scanner.py index 6bd0e3bd..69237bc0 100644 --- a/lib/python/Components/Scanner.py +++ b/lib/python/Components/Scanner.py @@ -26,8 +26,10 @@ def getType(file): return "application/ogg" elif ext == "dmpkg": return "application/x-dream-package" + elif ext == "ts": + return "video/MP2T" elif ext == "iso": - return "video/x-dvd-iso" + return "video/x-dvd-iso" elif file[-12:].lower() == "video_ts.ifo": return "video/x-dvd" return type diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index cb20dd22..e1e0e226 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -784,7 +784,11 @@ def filescan_open(list, session, **kwargs): mp.switchToPlayList() for file in list: - ref = eServiceReference(4097, 0, file.path) + if file.mimetype == "video/MP2T": + stype = 1 + else: + stype = 4097 + ref = eServiceReference(stype, 0, file.path) mp.playlist.addFile(ref) # TODO: rather play first than last file? @@ -812,7 +816,7 @@ def audioCD_open(list, session, **kwargs): def filescan(**kwargs): from Components.Scanner import Scanner, ScanPath mediatypes = [ - Scanner(mimetypes = ["video/mpeg"], + Scanner(mimetypes = ["video/mpeg", "video/MP2T"], paths_to_scan = [ ScanPath(path = "", with_subdirs = False), -- 2.30.2