This fixed the PicturePlayer to check if a file is local rather than accepting files...
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 7 Oct 2007 10:31:35 +0000 (10:31 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 7 Oct 2007 10:31:35 +0000 (10:31 +0000)
lib/python/Plugins/Extensions/PicturePlayer/plugin.py

index b6699bab00ab63e3346f199274449bdb029217da..b305b653b4b5193863a3b2d6041b0ccf3c82e7cf 100644 (file)
@@ -8,7 +8,7 @@ from Components.Label import Label
 from Components.ConfigList import ConfigList
 from Components.config import *
 
-from Tools.Directories import resolveFilename, pathExists, createDir, SCOPE_MEDIA
+from Tools.Directories import resolveFilename, fileExists, pathExists, createDir, SCOPE_MEDIA
 from Components.FileList import FileList
 from Components.AVSwitch import AVSwitch
 
@@ -537,8 +537,14 @@ def filescan_open(list, session, **kwargs):
 
 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 \
-               Scanner(mimetypes = ["image/jpeg", "image/png", "image/gif", "image/bmp"],
+               LocalScanner(mimetypes = ["image/jpeg", "image/png", "image/gif", "image/bmp"],
                        paths_to_scan = 
                                [
                                        ScanPath(path = "DCIM", with_subdirs = True),