+
+#TODO add *.iso to filescanner and ask when more than one iso file is found
+
+def filescan_open(list, session, **kwargs):
+ for x in list:
+ splitted = x.path.split('/')
+ print "splitted", splitted
+ if len(splitted) > 2:
+ if splitted[1] == 'autofs':
+ session.open(DVDPlayer, "/dev/%s" %(splitted[2]))
+ return
+ else:
+ print "splitted[0]", splitted[1]
+
+def filescan(**kwargs):
+ from Components.Scanner import Scanner, ScanPath
+
+ # Overwrite checkFile to only detect local
+ class LocalScanner(Scanner):
+ def checkFile(self, file):
+ return fileExists(file.path)
+
+ return \
+ LocalScanner(mimetypes = None,
+ paths_to_scan =
+ [
+ ScanPath(path = "video_ts", with_subdirs = False),
+ ],
+ name = "DVD",
+ description = "Play DVD",
+ openfnc = filescan_open,
+ )
+