physdev path start with /, like in hotplug. add dvd drive into devicedb. fix scanner...
[enigma2.git] / lib / python / Components / Scanner.py
index 5a26a7d4bcd277b681484e18ac77f186052e7104..86a5431d6279de86d5c1311831f744b878a76354 100644 (file)
@@ -16,7 +16,6 @@ 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
@@ -29,6 +28,8 @@ def getType(file):
                        return "audio/x-flac"
                elif ext == "dmpkg":
                        return "application/x-dream-package"
+               elif ext == "nfi":
+                       return "application/x-dream-image"
                elif ext == "ts":
                        return "video/MP2T"
                elif ext == "iso":
@@ -131,10 +132,10 @@ def scanDevice(mountpoint):
 
        # convert to list
        paths_to_scan = list(paths_to_scan)
-       
+
        from Components.Harddisk import harddiskmanager 
-       blockdev = mountpoint.split('/')[2]
-       error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
+       blockdev = mountpoint.rstrip("/").rsplit('/',1)[-1]
+       error, blacklisted, removable, is_cdrom, partitions, medium_found = harddiskmanager.getBlockDevInfo(blockdev)
 
        # now scan the paths
        for p in paths_to_scan: