The branch, eden has been updated
via f9286cbf79f7caf6eea11fb3ca506ac1c62a6d67 (commit)
from 93f1b4c81df783ba5b79064b2ba4abff67222a79 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=f9286cbf79f7caf6eea11fb3ca506ac1c62a6d67
commit f9286cbf79f7caf6eea11fb3ca506ac1c62a6d67
Author: amet <[email protected]>
Date: Wed Aug 22 00:00:46 2012 +0400
[service.watchdog] -v 0.6.2
- added multipath support
- added stricter triggering of library clean based on file type
diff --git a/service.watchdog/addon.xml b/service.watchdog/addon.xml
index 4647236..d9100a6 100644
--- a/service.watchdog/addon.xml
+++ b/service.watchdog/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.watchdog"
name="Library watchdog"
- version="0.6.1"
+ version="0.6.2"
provider-name="takoi">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/service.watchdog/changelog.txt b/service.watchdog/changelog.txt
index 08f0add..07a3edc 100644
--- a/service.watchdog/changelog.txt
+++ b/service.watchdog/changelog.txt
@@ -1,3 +1,7 @@
+[B]0.6.2[/B]
+- added multipath support
+- added stricter triggering of library clean based on file type
+
[B]0.6.1[/B]
- fixed: not able to resume from sleep mode on linux
- fixed: addon not able to start on windows xp when syscall is selected
diff --git a/service.watchdog/default.py b/service.watchdog/default.py
index ea81cd0..d2a4535 100644
--- a/service.watchdog/default.py
+++ b/service.watchdog/default.py
@@ -18,6 +18,7 @@ import simplejson
import xbmc
import xbmcaddon
from time import sleep
+from urllib import unquote
from threading import Thread
from watchdog.events import FileSystemEventHandler
@@ -30,6 +31,9 @@ WATCH_VIDEO = ADDON.getSetting('watchvideo') in ['true']
WATCH_MUSIC = ADDON.getSetting('watchmusic') in ['true']
DELAY = 1
+EXTENSIONS =
"|.nsv|.m4a|.flac|.aac|.strm|.pls|.rm|.rma|.mpa|.wav|.wma|.ogg|.mp3|.mp2|.m3u|.mod|.amf|.669|.dmf|.dsm|.far|.gdm|.imf|.it|.m15|.med|.okt|.s3m|.stm|.sfx|.ult|.uni|.xm|.sid|.ac3|.dts|.cue|.aif|.aiff|.wpl|.ape|.mac|.mpc|.mp+|.mpp|.shn|.zip|.rar|.wv|.nsf|.spc|.gym|.adx|.dsp|.adp|.ymf|.ast|.afc|.hps|.xsp|.xwav|.waa|.wvs|.wam|.gcm|.idsp|.mpdsp|.mss|.spt|.rsd|.mid|.kar|.sap|.cmc|.cmr|.dmc|.mpt|.mpd|.rmt|.tmc|.tm8|.tm2|.oga|.url|.pxml|.tta|.rss|.cm3|.cms|.dlt|.brstm|.wtv|.mka|.m4v|.3g2|.3gp|.nsv|.tp|.ts|.ty|.strm|.pls|.rm|.rmvb|.m3u|.ifo|.mov|.qt|.divx|.xvid|.bivx|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.mpeg|.mp4|.mkv|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.dvr-ms|.xsp|.mts|.m2t|.m2ts|.evo|.ogv|.sdp|.avs|.rec|.url|.pxml|.vc1|.h264|.rcv|.rss|.mpls|.webm|.bdmv|.wtv|.m4v|.3g2|.3gp|.nsv|.tp|.ts|.ty|.strm|.pls|.rm|.rmvb|.m3u|.m3u8|.ifo|.mov|.qt|.divx|.xvid|.bivx|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.mpeg|.mp4|.mkv|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.dvr-ms|.xsp|.mts|.m2t|.m2ts|.evo|.ogv|.sdp|.avs|.rec|.url|.pxml|.vc1|.h264|.rcv|.rss|.mpls|.webm|.bdmv|.wtv|"
+
+
if POLLING:
from watchdog.observers.polling import PollingObserver as Observer
else:
@@ -90,6 +94,10 @@ class EventHandler(FileSystemEventHandler):
self._scan()
def on_deleted(self, event):
+ if not event.is_directory:
+ _, ext = os.path.splitext(str(event.src_path))
+ if EXTENSIONS.find('|%s|' % ext) == -1:
+ return
self._clean()
def on_moved(self, event):
@@ -103,10 +111,19 @@ def get_media_sources(type):
query = '{"jsonrpc": "2.0", "method": "Files.GetSources", "params":
{"media": "%s"}, "id": 1}' % type
result = xbmc.executeJSONRPC(query)
json = simplejson.loads(result)
+ ret = []
if json.has_key('result'):
if json['result'].has_key('sources'):
- return [ e['file'] for e in json['result']['sources'] ]
- return []
+ paths = [ e['file'] for e in json['result']['sources'] ]
+ for path in paths:
+ #split and decode multipaths
+ if path.startswith("multipath://"):
+ for e in path.split("multipath://")[1].split('/'):
+ if e != "":
+ ret.append(unquote(e))
+ else:
+ ret.append(path)
+ return ret
def log(msg):
xbmc.log("%s: %s" % (ADDON_ID, msg), xbmc.LOGDEBUG)
diff --git a/service.watchdog/pathtools/__init__.py
b/service.watchdog/pathtools/__init__.py
old mode 100755
new mode 100644
diff --git a/service.watchdog/pathtools/path.py
b/service.watchdog/pathtools/path.py
old mode 100755
new mode 100644
diff --git a/service.watchdog/pathtools/patterns.py
b/service.watchdog/pathtools/patterns.py
old mode 100755
new mode 100644
diff --git a/service.watchdog/pathtools/version.py
b/service.watchdog/pathtools/version.py
old mode 100755
new mode 100644
-----------------------------------------------------------------------
Summary of changes:
service.watchdog/addon.xml | 2 +-
service.watchdog/changelog.txt | 4 ++++
service.watchdog/default.py | 21 +++++++++++++++++++--
3 files changed, 24 insertions(+), 3 deletions(-)
mode change 100755 => 100644 service.watchdog/pathtools/__init__.py
mode change 100755 => 100644 service.watchdog/pathtools/path.py
mode change 100755 => 100644 service.watchdog/pathtools/patterns.py
mode change 100755 => 100644 service.watchdog/pathtools/version.py
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons