do not show inaccessible devices in deviceselection
[vuplus_dvbapp] / lib / python / Plugins / Extensions / MediaScanner / plugin.py
old mode 100644 (file)
new mode 100755 (executable)
index 7d57ce0..2c31197
@@ -17,6 +17,7 @@ def mountpoint_choosen(option):
 
        from Screens.ChoiceBox import ChoiceBox
 
+       print "scanning", option
        (description, mountpoint, session) = option
        res = scanDevice(mountpoint)
 
@@ -41,6 +42,9 @@ def scan(session):
 
        parts = [ (r.description, r.mountpoint, session) for r in harddiskmanager.getMountedPartitions(onlyhotplug = False)]
        if len(parts):
+               for x in parts:
+                       if not access(x[1], F_OK|R_OK):
+                               parts.remove(x) 
                session.openWithCallback(mountpoint_choosen, ChoiceBox, title = _("Please Select Medium to be Scanned"), list = parts)
 
 def main(session, **kwargs):