aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/SystemPlugins/Hotplug
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-06-24 18:29:34 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-06-24 18:29:34 +0000
commitf7d4b3e46c34d1ed7983c20577da833405f541f8 (patch)
tree110fd0e4c23cd48be427494e3ad86686ac38d6f2 /lib/python/Plugins/SystemPlugins/Hotplug
parent3b898971c9e352bec83dfcab5b9d6ae3534df719 (diff)
downloadenigma2-f7d4b3e46c34d1ed7983c20577da833405f541f8.tar.gz
enigma2-f7d4b3e46c34d1ed7983c20577da833405f541f8.zip
auto start mediascanner on hotplug change (new device plugged or medium
injected) add mediascanner support to dvd player plugin
Diffstat (limited to 'lib/python/Plugins/SystemPlugins/Hotplug')
-rw-r--r--lib/python/Plugins/SystemPlugins/Hotplug/plugin.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
index 89e536ba..469b1dd0 100644
--- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
@@ -33,14 +33,21 @@ class Hotplug(Protocol):
action = v.get("ACTION")
device = v.get("DEVPATH")
physdevpath = v.get("PHYSDEVPATH")
+ media_state = v.get("X_E2_MEDIA_STATUS")
dev = device.split('/')[-1]
- if action == "add":
+ if action is not None and action == "add":
print "Medium found in", self.getUserfriendlyDeviceName(dev)
harddiskmanager.addHotplugPartition(dev, self.getUserfriendlyDeviceName(physdevpath))
- elif action == "remove":
+ elif action is not None and action == "remove":
harddiskmanager.removeHotplugPartition(dev)
+ elif media_state is not None:
+ if media_state == '1':
+ harddiskmanager.removeHotplugPartition(dev)
+ harddiskmanager.addHotplugPartition(dev, self.getUserfriendlyDeviceName(physdevpath))
+ elif media_state == '0':
+ harddiskmanager.removeHotplugPartition(dev)
def autostart(reason, **kwargs):
if reason == 0: