git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup eConsoleAppContainer code.. execute is now only possible to call with
[enigma2.git]
/
lib
/
python
/
Components
/
Scanner.py
diff --git
a/lib/python/Components/Scanner.py
b/lib/python/Components/Scanner.py
index 860918c034d75add219167a8ca64a971476f639c..d944c4c795bdb29fb4addf433bdf06a3491b56ac 100644
(file)
--- a/
lib/python/Components/Scanner.py
+++ b/
lib/python/Components/Scanner.py
@@
-24,6
+24,20
@@
def getType(file):
return "application/x-debian-package"
elif ext == "ogg":
return "application/ogg"
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 == "nfi":
+ return "application/x-dream-image"
+ elif ext == "ts":
+ return "video/MP2T"
+ elif ext == "iso":
+ 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:
return type
class Scanner:
@@
-72,7
+86,7
@@
class ScanFile:
def __init__(self, path, mimetype = None, size = None, autodetect = True):
self.path = path
if mimetype is None and autodetect:
def __init__(self, path, mimetype = None, size = None, autodetect = True):
self.path = path
if mimetype is None and autodetect:
-
(self.mimetype, _) = guess_t
ype(path)
+
self.mimetype = getT
ype(path)
else:
self.mimetype = mimetype
self.size = size
else:
self.mimetype = mimetype
self.size = size
@@
-118,6
+132,10
@@
def scanDevice(mountpoint):
# convert to list
paths_to_scan = list(paths_to_scan)
# convert to list
paths_to_scan = list(paths_to_scan)
+
+ from Components.Harddisk import harddiskmanager
+ blockdev = mountpoint.rsplit('/',1)[-1]
+ error, blacklisted, removable, is_cdrom, partitions = harddiskmanager.getBlockDevInfo(blockdev)
# now scan the paths
for p in paths_to_scan:
# now scan the paths
for p in paths_to_scan:
@@
-125,7
+143,11
@@
def scanDevice(mountpoint):
for root, dirs, files in os_walk(path):
for f in files:
for root, dirs, files in os_walk(path):
for f in files:
- sfile = ScanFile(os_path.join(root, f))
+ path = os_path.join(root, f)
+ if is_cdrom and path.endswith(".wav") and path[-13:-6] == ("/track-"):
+ sfile = ScanFile(path,"audio/x-cda")
+ else:
+ sfile = ScanFile(path)
for s in scanner:
s.handleFile(res, sfile)
for s in scanner:
s.handleFile(res, sfile)