aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/Extensions
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-07-19 13:56:05 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-07-19 13:56:05 +0000
commit36c9aa923ec2d3b25795404ee7ce553e7e0b52de (patch)
tree0cbc2962bb6d13e15fa50d37b2703559913d752b /lib/python/Plugins/Extensions
parentbaa6968ed152a4e78ba27e3e48364a6b62680db2 (diff)
downloadenigma2-36c9aa923ec2d3b25795404ee7ce553e7e0b52de.tar.gz
enigma2-36c9aa923ec2d3b25795404ee7ce553e7e0b52de.zip
show media selector instead of hardcoded /hdd/ scan
Diffstat (limited to 'lib/python/Plugins/Extensions')
-rw-r--r--lib/python/Plugins/Extensions/MediaScanner/plugin.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/python/Plugins/Extensions/MediaScanner/plugin.py b/lib/python/Plugins/Extensions/MediaScanner/plugin.py
index 55e10810..3c4b9779 100644
--- a/lib/python/Plugins/Extensions/MediaScanner/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaScanner/plugin.py
@@ -93,7 +93,7 @@ class ScanPath:
# ),
# ]
-def ScanDevice(mountpoint):
+def scanDevice(mountpoint):
from Components.PluginComponent import plugins
scanner = [ ]
@@ -152,10 +152,15 @@ def execute(option):
(_, scanner, files, session) = option
scanner.open(files, session)
-def scan(session):
+
+def mountpoint_choosen(option):
+ if option is None:
+ return
+
from Screens.ChoiceBox import ChoiceBox
- # HARDCODED - need to scan all mountpoints
- res = ScanDevice("/hdd/")
+
+ (description, mountpoint, session) = option
+ res = scanDevice(mountpoint)
list = [ (r.description, r, res[r], session) for r in res ]
@@ -167,6 +172,14 @@ def scan(session):
title = "The following files were found...",
list = list)
+def scan(session):
+ from Screens.ChoiceBox import ChoiceBox
+
+ from Components.Harddisk import harddiskmanager
+
+ parts = [ (r.description, r.mountpoint, session) for r in harddiskmanager.getMountedPartitions() ]
+ session.openWithCallback(mountpoint_choosen, ChoiceBox, title = "Please Select Medium to be Scanned", list = parts)
+
def main(session, **kwargs):
scan(session)