aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>2008-10-02 11:31:54 +0000
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>2008-10-02 11:31:54 +0000
commitab26adc86e6198e65e20d6bf707a6011208111ce (patch)
tree68e7650d4ba576eb55339d3b291364bcbfcc1c7a /lib/python
parent0d6cafcc5471dbaee5b2a1ce68b6b6a5603abe17 (diff)
downloadenigma2-ab26adc86e6198e65e20d6bf707a6011208111ce.tar.gz
enigma2-ab26adc86e6198e65e20d6bf707a6011208111ce.zip
allow MediaPlayer AudioCD playback only for what appear to be AudioCDs
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Scanner.py14
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/plugin.py3
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/python/Components/Scanner.py b/lib/python/Components/Scanner.py
index 69237bc0..f7e307b7 100644
--- a/lib/python/Components/Scanner.py
+++ b/lib/python/Components/Scanner.py
@@ -126,6 +126,14 @@ def scanDevice(mountpoint):
# convert to list
paths_to_scan = list(paths_to_scan)
+
+ from Components.Harddisk import HarddiskManager
+ class CdromManager(HarddiskManager):
+ def __init__(self):
+ pass
+ cdaman = CdromManager()
+ blockdev = mountpoint.split('/')[2]
+ error, blacklisted, removable, is_cdrom, partitions = cdaman.getBlockDevInfo(blockdev)
# now scan the paths
for p in paths_to_scan:
@@ -133,7 +141,11 @@ def scanDevice(mountpoint):
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)
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index f819d782..752a036b 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -848,7 +848,8 @@ def filescan(**kwargs):
)]
try:
from Plugins.Extensions.CDInfo.plugin import Query
- mediatypes.insert(0,Scanner(mimetypes = ["audio/x-cda", "audio/x-wav"],
+ mediatypes.append(
+ Scanner(mimetypes = ["audio/x-cda"],
paths_to_scan =
[
ScanPath(path = "", with_subdirs = False),