aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-12-18 23:46:56 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-12-18 23:46:56 +0000
commit46b35be7bd902e752ecf89c2b97f8eec8c46a5d7 (patch)
treea54e3e981db4856f408f32748f36c7923e8b9c36 /lib/python
parent28d07a51cfd1df07ec14c60a18992ffc55e3f217 (diff)
downloadenigma2-46b35be7bd902e752ecf89c2b97f8eec8c46a5d7.tar.gz
enigma2-46b35be7bd902e752ecf89c2b97f8eec8c46a5d7.zip
add (incomplete) media scan support
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/PicturePlayer/plugin.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
index bb8edd6e..8db85ced 100644
--- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
@@ -532,5 +532,26 @@ class picmain(Screen):
def main(session, **kwargs):
session.open(picmain)
+def filescan_open(list, session, **kwargs):
+ session.open(picmain) # list
+
+def filescan():
+ # we expect not to be called if the MediaScanner plugin is not available,
+ # thus we don't catch an ImportError exception here
+ from Plugins.Extensions.MediaScanner.plugin import Scanner, ScanPath
+ return \
+ Scanner(extensions = ["jpg", "jpe", "jpeg"],
+ paths_to_scan =
+ [
+ ScanPath(path = "DCIM", with_subdirs = True),
+ ScanPath(path = "", with_subdirs = False),
+ ],
+ name = "Pictures",
+ description = "View Photos...",
+ openfnc = filescan_open,
+ )
+
def Plugins(**kwargs):
- return PluginDescriptor(name="PicturePlayer", description="Picture Viewer (BMP, PNG, JPG)", icon="pictureplayer.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)
+ return \
+ [PluginDescriptor(name="PicturePlayer", description="Picture Viewer (BMP, PNG, JPG)", icon="pictureplayer.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main),
+ PluginDescriptor(name="PicturePlayer", where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan)]