The branch, frodo has been updated
via ea8de899151662685463892b013c14e921357dc0 (commit)
from 14688290167730fea4f17520ec009350a201115a (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=ea8de899151662685463892b013c14e921357dc0
commit ea8de899151662685463892b013c14e921357dc0
Author: ronie <[email protected]>
Date: Thu Feb 28 18:50:55 2013 +0100
[service.watchdog] -v0.7.2
diff --git a/service.watchdog/addon.xml b/service.watchdog/addon.xml
index d723551..ac8c9f2 100644
--- a/service.watchdog/addon.xml
+++ b/service.watchdog/addon.xml
@@ -2,7 +2,7 @@
<addon
id="service.watchdog"
name="Watchdog"
- version="0.7.1"
+ version="0.7.2"
provider-name="takoi">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
diff --git a/service.watchdog/changelog.txt b/service.watchdog/changelog.txt
index c518228..55df404 100644
--- a/service.watchdog/changelog.txt
+++ b/service.watchdog/changelog.txt
@@ -1,3 +1,7 @@
+[B]0.7.2[/B]
+- added option for disabling pause on playback
+- other minor tweaks
+
[B]0.7.1[/B]
- fixed: library was cleaned even if it was disabled
diff --git a/service.watchdog/core/main.py b/service.watchdog/core/main.py
index fdf858a..b2a2fcf 100644
--- a/service.watchdog/core/main.py
+++ b/service.watchdog/core/main.py
@@ -37,6 +37,7 @@ WATCH_VIDEO = ADDON.getSetting('watchvideo') == 'true'
WATCH_MUSIC = ADDON.getSetting('watchmusic') == 'true'
DELAY = int("0"+ADDON.getSetting('delay')) or 1
SHOW_NOTIFICATIONS = ADDON.getSetting('notifications') == 'true'
+PAUSE_ON_PLAYBACK = ADDON.getSetting('pauseonplayback') == 'true'
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|"
@@ -44,7 +45,7 @@ class XBMCActor(pykka.ThreadingActor):
""" Messaging interface to xbmc's executebuiltin calls """
def _xbmc_is_busy(self):
sleep(1) # visibility cant be immediately trusted. Give xbmc time to render
- return (xbmc.Player().isPlaying()
+ return ((xbmc.Player().isPlaying() and PAUSE_ON_PLAYBACK)
or xbmc.getCondVisibility('Library.IsScanning')
or xbmc.getCondVisibility('Window.IsActive(10101)'))
@@ -53,7 +54,7 @@ class XBMCActor(pykka.ThreadingActor):
while self._xbmc_is_busy():
pass
log("scanning %s (%s)" % (path, library))
- xbmc.executebuiltin("UpdateLibrary(%s,%s)" % (library, path))
+ xbmc.executebuiltin("UpdateLibrary(%s,\"%s\")" % (library, path))
def clean(self, library, path=None):
""" Tell xbmc to clean. Returns immediately when scanning has started. """
@@ -161,7 +162,7 @@ def log(msg):
def notify(msg):
if SHOW_NOTIFICATIONS:
- xbmc.executebuiltin("XBMC.Notification(Library Watchdog, %s)" % msg)
+ xbmc.executebuiltin("XBMC.Notification(Library Watchdog,\"%s\")" % msg)
def select_observer(path):
import observers
@@ -176,7 +177,9 @@ def select_observer(path):
def watch(library, xbmc_actor):
threads = []
- for path in get_media_sources(library):
+ sources = get_media_sources(library)
+ log("%s sources %s" % (library, sources))
+ for path in sources:
path = path.encode('utf-8')
observer_cls = select_observer(path)
if observer_cls:
diff --git a/service.watchdog/core/polling.py b/service.watchdog/core/polling.py
index 84d8267..8d44c7b 100644
--- a/service.watchdog/core/polling.py
+++ b/service.watchdog/core/polling.py
@@ -18,6 +18,10 @@ from functools import partial
from watchdog.observers.api import EventEmitter, BaseObserver
from watchdog.events import DirDeletedEvent, DirCreatedEvent
from main import log
+from main import PAUSE_ON_PLAYBACK
+
+def _paused():
+ return xbmc.Player().isPlaying() and PAUSE_ON_PLAYBACK
def hidden(path):
return path.startswith('.')
@@ -37,7 +41,6 @@ class PathSnapsot(object):
self._dirs = set()
for dirs, files in walker(root):
self._dirs.update(dirs)
- self._paths.update(dirs)
self._paths.update(files)
def path_diff(self, other):
@@ -72,7 +75,7 @@ class Poller(EventEmitter):
def queue_events(self, timeout):
time.sleep(timeout)
- if not xbmc.Player().isPlaying():
+ if not _paused():
new_snapshot = self._make_snapshot(self.watch.path)
created, deleted, modified = self._snapshot.diff(new_snapshot)
self._snapshot = new_snapshot
diff --git a/service.watchdog/core/polling_xbmc.py
b/service.watchdog/core/polling_xbmc.py
index a174dab..ea2e0c0 100644
--- a/service.watchdog/core/polling_xbmc.py
+++ b/service.watchdog/core/polling_xbmc.py
@@ -27,7 +27,7 @@ def _walker_recursive(top):
yield dirs, files
for d in dirs:
for dirs, files in _walker_recursive(d):
- yield _join_path(top, dirs), _join_path(top, files)
+ yield dirs, files
def _walker_depth_1(top):
dirs, files = xbmcvfs.listdir(top)
diff --git a/service.watchdog/lib/watchdog/watchmedo.py
b/service.watchdog/lib/watchdog/watchmedo.py
old mode 100644
new mode 100755
diff --git a/service.watchdog/resources/language/English/strings.xml
b/service.watchdog/resources/language/English/strings.xml
index 8aa29fe..e69c574 100644
--- a/service.watchdog/resources/language/English/strings.xml
+++ b/service.watchdog/resources/language/English/strings.xml
@@ -2,8 +2,8 @@
<strings>
<string id="30001">General</string>
<string id="30002">Advanced</string>
- <string id="30003">Watch video library</string>
- <string id="30004">Watch music library</string>
+ <string id="30003">Watch video sources</string>
+ <string id="30004">Watch music sources</string>
<string id="30005">Clean library when files are moved or deleted</string>
<string id="30006">Method</string>
<string id="30007">Auto</string>
@@ -15,5 +15,6 @@
<string id="30013">Depth 1 (Look in top directory only)</string>
<string id="30014">Depth 2 (Look 2 directories deep)</string>
<string id="30015">Depth inf. (Look in every subdirectory)</string>
+ <string id="30016">Pause on playback</string>
</strings>
diff --git a/service.watchdog/resources/settings.xml
b/service.watchdog/resources/settings.xml
index 7c18c68..81ec9df 100644
--- a/service.watchdog/resources/settings.xml
+++ b/service.watchdog/resources/settings.xml
@@ -5,6 +5,7 @@
<setting label="30004" id="watchmusic" type="bool" default="true"/>
<setting label="30005" id="clean" type="bool" default="false"/>
<setting label="30011" id="notifications" type="bool" default="true"/>
+ <setting label="30016" id="pauseonplayback" type="bool" default="true"/>
</category>
<category label="30002">
<setting label="30006" id="method" type="select" lvalues="30007|30008"
default="0"/>
-----------------------------------------------------------------------
Summary of changes:
service.watchdog/addon.xml | 2 +-
service.watchdog/changelog.txt | 4 ++++
service.watchdog/core/main.py | 11 +++++++----
service.watchdog/core/polling.py | 7 +++++--
service.watchdog/core/polling_xbmc.py | 2 +-
.../resources/language/English/strings.xml | 5 +++--
service.watchdog/resources/settings.xml | 1 +
7 files changed, 22 insertions(+), 10 deletions(-)
mode change 100644 => 100755 service.watchdog/lib/watchdog/watchmedo.py
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons