allow gstreamer to signalize missing plugins to the gui (requires reconfiguring enigm...
[enigma2.git] / lib / python / Components / Scanner.py
index f7e307b..5a26a7d 100644 (file)
@@ -16,6 +16,7 @@ def getExtension(file):
 
 def getType(file):
        (type, _) = guess_type(file)
+       print "guessed type:", type
        if type is None:
                # Detect some mimetypes unknown to dm7025
                # TODO: do mimetypes.add_type once should be better
@@ -24,6 +25,8 @@ def getType(file):
                        return "application/x-debian-package"
                elif ext == "ogg":
                        return "application/ogg"
+               elif ext == "flac":
+                       return "audio/x-flac"
                elif ext == "dmpkg":
                        return "application/x-dream-package"
                elif ext == "ts":
@@ -32,6 +35,8 @@ def getType(file):
                        return "video/x-dvd-iso"
                elif file[-12:].lower() == "video_ts.ifo":
                        return "video/x-dvd"
+               elif ext == "dat" and file[-11:-6].lower() == "avseq":
+                       return "video/x-vcd"
        return type
 
 class Scanner:
@@ -127,13 +132,9 @@ def scanDevice(mountpoint):
        # convert to list
        paths_to_scan = list(paths_to_scan)
        
-       from Components.Harddisk import HarddiskManager 
-       class CdromManager(HarddiskManager):
-               def __init__(self):
-                       pass
-       cdaman = CdromManager()
+       from Components.Harddisk import harddiskmanager 
        blockdev = mountpoint.split('/')[2]
-       error, blacklisted, removable, is_cdrom, partitions = cdaman.getBlockDevInfo(blockdev)
+       error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
 
        # now scan the paths
        for p in paths_to_scan: