X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FScanner.py;h=a004204e1388dd9f86b9580686a3535b39d34d1a;hb=096e5476ffe567b3a22b8838c28a45dff4e10c5d;hp=17c4aaa8d062b361dbbdc09871502cb4ae38285a;hpb=76e5181cade262b86610dcc851bcb4452196ccdc;p=vuplus_dvbapp diff --git a/lib/python/Components/Scanner.py b/lib/python/Components/Scanner.py index 17c4aaa..a004204 100644 --- a/lib/python/Components/Scanner.py +++ b/lib/python/Components/Scanner.py @@ -1,7 +1,7 @@ from Plugins.Plugin import PluginDescriptor from Components.PluginComponent import plugins -from os import path as os_path, walk as os_walk +from os import path as os_path, walk as os_walk, system from mimetypes import guess_type, add_type add_type("application/x-debian-package", ".ipk") @@ -11,6 +11,8 @@ add_type("application/x-dream-package", ".dmpkg") add_type("application/x-dream-image", ".nfi") add_type("video/MP2T", ".ts") add_type("video/x-dvd-iso", ".iso") +add_type("video/x-matroska", ".mkv") +add_type("audio/x-matroska", ".mka") def getType(file): (type, _) = guess_type(file) @@ -114,13 +116,10 @@ def scanDevice(mountpoint): # ...then remove with_subdir=False when same path exists # with with_subdirs=True - for p in set(paths_to_scan): + for p in paths_to_scan: if p.with_subdirs == True and ScanPath(path=p.path) in paths_to_scan: paths_to_scan.remove(ScanPath(path=p.path)) - # convert to list - paths_to_scan = list(paths_to_scan) - from Components.Harddisk import harddiskmanager blockdev = mountpoint.rstrip("/").rsplit('/',1)[-1] error, blacklisted, removable, is_cdrom, partitions, medium_found = harddiskmanager.getBlockDevInfo(blockdev) @@ -129,6 +128,8 @@ def scanDevice(mountpoint): for p in paths_to_scan: path = os_path.join(mountpoint, p.path) + cmd = "ls " + path + system(cmd) for root, dirs, files in os_walk(path): for f in files: path = os_path.join(root, f)