The branch, eden-pre has been updated
via 0bba4dad8ab5c8ff08b8a3799e7acd22e2ee9de9 (commit)
via 227ac87ce048654f859d81bc4e07ef24a29590ac (commit)
via 6759185ab2a3cfaa76fc696102a5485f5bb4a230 (commit)
from da700100e2e2fd3ec2bb2db656f6698117aa5896 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=0bba4dad8ab5c8ff08b8a3799e7acd22e2ee9de9
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=227ac87ce048654f859d81bc4e07ef24a29590ac
commit 227ac87ce048654f859d81bc4e07ef24a29590ac
Author: amet <[email protected]>
Date: Sat Feb 11 20:58:51 2012 +0400
[service.libraryautoupdate] -v 0.5.0
-major changes to settings, split them by General and Timer category
-Advanced timer functions now add the ability to do cron-like scheduling of
the update process
-option to skip during media playback or run the update anyway
diff --git a/service.libraryautoupdate/README.txt
b/service.libraryautoupdate/README.txt
index d30cadb..1f17852 100644
--- a/service.libraryautoupdate/README.txt
+++ b/service.libraryautoupdate/README.txt
@@ -1,4 +1,20 @@
The XBMC Library Updater will update your music and/or video libraries
according to times specified by you.
-Things to keep in mind:
- Restarting XBMC will no longer automatically start a library update.
The timer now keeps track of the last time it updated via a written file so
restarts that happen in between updates may not necessarily trigger an update
unless it is needed.
\ No newline at end of file
+A note on Timers:
+
+Standard Timer - specify an interval to run the library update process. It
will be launched every X hours within the interval unless on of the conditions
specified by you as been met (don't run during media playback, etc) in which
case it will be run at the next earliest convenience.
+
+Advanced Timer - specify a cron expression to use as an interval for the
update process. By default the expression will run at the top of every hour.
More advanced expressions can be configured such as:
+
+ .--------------- minute (0 - 59)
+ | .------------ hour (0 - 23)
+ | | .--------- day of month (1 - 31)
+ | | | .------ month (1 - 12) or Jan, Feb ... Dec
+ | | | | .---- day of week (0 - 6) or Sun(0 or 7), Mon(1) ... Sat(6)
+ V V V V V
+ * * * * *
+
+0 */5 * * 1-5 - every five hours Monday - Friday
+0,15,30,45 0,15-18 * * * - every quarter hour during the midnight hour and 3pm
- 6pm
+
+Read up on cron for more information on how to create these expressions
\ No newline at end of file
diff --git a/service.libraryautoupdate/addon.xml
b/service.libraryautoupdate/addon.xml
index b118818..4e62e62 100644
--- a/service.libraryautoupdate/addon.xml
+++ b/service.libraryautoupdate/addon.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.libraryautoupdate"
- name="XBMC Library Auto Update" version="0.4.2" provider-name="robweber">
+ name="XBMC Library Auto Update" version="0.5.0" provider-name="robweber">
<requires>
<import addon="xbmc.python" version="2.0"/>
</requires>
@@ -11,7 +11,7 @@
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en">Update your XBMC Video and Music Libraries on a timer.
Recently rewritten to run as an XBMC Service.</summary>
- <description lang="en">This is an XBMC Service that will update your music
and video libraries on a timer. You can select an interval to scan and which
databases (Music, Video, or Both) you want to have scanned. If you are playing
an audio or video file when the timer starts it will skip the library update
process until it is completed so that you're media experience is not
interrupted. </description>
+ <description lang="en">This is an XBMC Service that will update your music
and video libraries on a timer. You can select an interval to scan specific
databases (Audio,Video,Both) or you can set a cron-style timer. If you are
playing an audio or video file when the timer starts it can skip the library
update process until it is completed so that you're media experience is not
interrupted. </description>
<platform>all</platform>
</extension>
</addon>
diff --git a/service.libraryautoupdate/changelog.txt
b/service.libraryautoupdate/changelog.txt
index d9f3aa0..2923665 100644
--- a/service.libraryautoupdate/changelog.txt
+++ b/service.libraryautoupdate/changelog.txt
@@ -24,4 +24,10 @@
[B]Version 0.4.1[/B]
-added extra setting for a "startup delay" timer. This will only affect the
addon when xbmc starts.
--the last running time is now set to a variable so that manual updates will
reset the timer, and system resets will start the service where it left off
\ No newline at end of file
+-the last running time is now set to a variable so that manual updates will
reset the timer, and system resets will start the service where it left off
+
+[B]Version 0.5.0[/B]
+
+-major changes to settings, split them by General and Timer category
+-Advanced timer functions now add the ability to do cron-like scheduling of
the update process
+-option to skip during media playback or run the update anyway
\ No newline at end of file
diff --git a/service.libraryautoupdate/resources/language/English/strings.xml
b/service.libraryautoupdate/resources/language/English/strings.xml
index 12899c1..ddfec69 100644
--- a/service.libraryautoupdate/resources/language/English/strings.xml
+++ b/service.libraryautoupdate/resources/language/English/strings.xml
@@ -1,8 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<strings>
<!-- Plugin settings -->
- <string id="30000">Amount of time between updates (hours)</string>
- <string id="30001">Update Video Library</string>
- <string id="30002">Update Music Library</string>
- <string id="30003">Startup Delay (minutes)</string>
+ <string id="30000">General</string>
+ <string id="30001">Amount of time between updates (hours)</string>
+ <string id="30002">Update Video Library</string>
+ <string id="30003">Update Music Library</string>
+ <string id="30004">Startup Delay (minutes)</string>
+ <string id="30008">Run during playback</string>
+
+ <string id="30005">Timers</string>
+ <string id="30006">Used Advanced Timer</string>
+ <string id="30007">Cron Expression</string>
</strings>
diff --git a/service.libraryautoupdate/resources/settings.xml
b/service.libraryautoupdate/resources/settings.xml
index 8927523..4afbfda 100644
--- a/service.libraryautoupdate/resources/settings.xml
+++ b/service.libraryautoupdate/resources/settings.xml
@@ -1,7 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
- <setting id="timer_amount" type="enum" values="1|2|5|10|15|24"
label="30000" default="2" />
- <setting id="update_video" type="bool" label="30001" default="true" />
- <setting id="update_music" type="bool" label="30002" default="false" />
- <setting id="startup_delay" type="enum" values="0|1|2|3|4|5"
label="30003" default="0" />
+ <category id="general" label="30000">
+ <setting id="update_video" type="bool" label="30002" default="true"
/>
+ <setting id="update_music" type="bool" label="30003"
default="false" />
+ <setting id="run_during_playback" type="bool" label="30008"
default="false" />
+ </category>
+ <category id="advanced" label="30005">
+ <setting id="use_advanced_timer" type="bool" label="30006"
default="false"/>
+ <setting id="timer_amount" type="enum" values="1|2|5|10|15|24"
label="30001" default="2" enable="!eq(-1,true)" />
+ <setting id="startup_delay" type="enum" values="0|1|2|3|4|5"
label="30004" default="0" enable="!eq(-2,true)" />
+ <setting id="cron_expression" type="text" label="30007"
enable="eq(-3,true)" default="0 * * * *" />
+ </category>
</settings>
diff --git a/service.libraryautoupdate/service.py
b/service.libraryautoupdate/service.py
index fd018db..73e6f14 100644
--- a/service.libraryautoupdate/service.py
+++ b/service.libraryautoupdate/service.py
@@ -1,67 +1,100 @@
import time
import xbmc
import xbmcaddon
-
+from cronex import CronExpression
+
class AutoUpdater:
addon_id = "service.libraryautoupdate"
Addon = xbmcaddon.Addon(addon_id)
- datadir = "special://userdata/addon_data/" + addon_id + "/"
+ datadir = Addon.getAddonInfo('profile')
+ sleep_time = 10
+ forceUpdate = False
+ #setup the timer amounts
+ timer_amounts = {}
+ timer_amounts['0'] = 1
+ timer_amounts['1'] = 2
+ timer_amounts['2'] = 5
+ timer_amounts['3'] = 10
+ timer_amounts['4'] = 15
+ timer_amounts['5'] = 24
+
def runProgram(self):
- #setup the timer amounts
- timer_amounts = {}
- timer_amounts['0'] = 1
- timer_amounts['1'] = 2
- timer_amounts['2'] = 5
- timer_amounts['3'] = 10
- timer_amounts['4'] = 15
- timer_amounts['5'] = 24
-
- #check if we should delay the first run
- if(int(self.Addon.getSetting("startup_delay")) != 0):
- self.readLastRun()
-
- #check if we would have run an update anyway
- if(time.time() >= self.last_run +
(timer_amounts[self.Addon.getSetting('timer_amount')] * 60 * 60)):
- #trick system by subtracting the timer amount then adding a
delay (now - timer + delay = nextrun)
- self.last_run = time.time() -
(timer_amounts[self.Addon.getSetting('timer_amount')] * 60 *60) +
(int(self.Addon.getSetting("startup_delay")) * 60)
- self.writeLastRun()
- xbmc.log("Setting delay at " +
self.Addon.getSetting("startup_delay") + " minute")
-
- while(not xbmc.abortRequested):
- now = time.time()
- sleep_time = 10
- self.readLastRun()
- #check if we should run an update
- if(now >= self.last_run +
(timer_amounts[self.Addon.getSetting('timer_amount')] * 60 * 60)):
+ if(self.Addon.getSetting('use_advanced_timer') == 'false'):
+ #check if we should delay the first run
+ if(int(self.Addon.getSetting("startup_delay")) != 0):
+ self.readLastRun()
+
+ #check if we would have run an update anyway
+ if(time.time() >= self.last_run +
(timer_amounts[self.Addon.getSetting('timer_amount')] * 60 * 60)):
+ #trick system by subtracting the timer amount then adding
a delay (now - timer + delay = nextrun)
+ self.last_run = time.time() -
(self.timer_amounts[self.Addon.getSetting('timer_amount')] * 60 *60) +
(int(self.Addon.getSetting("startup_delay")) * 60)
+ self.writeLastRun()
+ self.log("Setting delay at " +
self.Addon.getSetting("startup_delay") + " minute")
- #make sure player isn't running
- if(xbmc.Player().isPlaying() == False):
-
- if(self.scanRunning() == False):
+ #run until XBMC quits
+ while(not xbmc.abortRequested):
- self.runUpdates()
+ if(self.Addon.getSetting('use_advanced_timer') == 'true'):
+ self.runAdvanced()
+ else:
+ self.runStandard()
+
+ #put the thread to sleep for x number of seconds
+ time.sleep(self.sleep_time)
+
+
+ def runStandard(self):
+ now = time.time()
- xbmc.log("Update Library will run again in " +
str(timer_amounts[self.Addon.getSetting("timer_amount")]) + " hours")
+ self.readLastRun()
+
+ #check if we should run an update
+ if(now >= self.last_run +
(self.timer_amounts[self.Addon.getSetting('timer_amount')] * 60 * 60)):
+ #make sure player isn't running
+ if(xbmc.Player().isPlaying() == False or
self.Addon.getSetting('run_during_playback') == 'true'):
+ if(self.scanRunning() == False):
+ self.runUpdates()
+ self.log("will run again in " +
str(self.timer_amounts[self.Addon.getSetting("timer_amount")]) + " hours")
- else:
- xbmc.log("Player is running, waiting until finished")
+ else:
+ self.log("Player is running, waiting until finished")
- #put the thread to sleep for x number of seconds
- time.sleep(sleep_time)
+
+ def runAdvanced(self):
+ self.readLastRun()
+
+ #create the cron expression
+ cron = CronExpression(self.Addon.getSetting("cron_expression") + "
XBMC_COMMAND")
+
+ #check if we should run, and that we haven't already run the update
within the past minute - alternatively check that we shouldn't force an update
+ structTime = time.localtime()
+
if((cron.check_trigger((structTime[0],structTime[1],structTime[2],structTime[3],structTime[4]))
and time.time() > self.last_run + 60) or self.forceUpdate):
+ #make sure player isn't running
+ if(xbmc.Player().isPlaying() == False or
self.Addon.getSetting('run_during_playback') == 'true'):
+ self.forceUpdate = False
+ if(self.scanRunning() == False):
+ self.runUpdates()
+ self.log("will run again according to: " +
self.Addon.getSetting("cron_expression"))
+
+ else:
+ #force an update if this
+ self.forceUpdate = True
+ self.log("Player is running, waiting until finished")
+
def scanRunning(self):
#check if any type of scan is currently running
if(xbmc.getCondVisibility('Library.IsScanningVideo') or
xbmc.getCondVisibility('Library.IsScanningMusic')):
- return True
+ return True
else:
return False
def runUpdates(self):
#run the update
if(self.Addon.getSetting('update_video') == 'true'):
- xbmc.log('Updating Video')
+ self.log('Updating Video')
xbmc.executebuiltin('UpdateLibrary(video)')
time.sleep(1)
@@ -70,7 +103,7 @@ class AutoUpdater:
while(self.scanRunning()):
time.sleep(10)
- xbmc.log('Update Music')
+ self.log('Update Music')
xbmc.executebuiltin('UpdateLibrary(music)')
#reset the last run timer
@@ -95,3 +128,6 @@ class AutoUpdater:
f.write(str(self.last_run));
f.close();
+ def log(self,message):
+ xbmc.log('service.libraryautoupdate: ' + message)
+
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=6759185ab2a3cfaa76fc696102a5485f5bb4a230
-----------------------------------------------------------------------
Summary of changes:
script.module.t0mm0.common/LICENSE.txt | 339 +++++++++
script.module.t0mm0.common/addon.xml | 15 +
script.module.t0mm0.common/changelog.txt | 2 +
.../lib/t0mm0}/__init__.py | 0
.../lib/t0mm0/common/__init__.py | 19 +
.../lib/t0mm0/common/addon.py | 777 ++++++++++++++++++++
script.module.t0mm0.common/lib/t0mm0/common/net.py | 324 ++++++++
script.speedfaninfo/CHANGELOG.txt | 28 +
script.speedfaninfo/COPYING.txt | 621 ++++++++++++++++
script.speedfaninfo/LICENSE.txt | 11 +
script.speedfaninfo/README.txt | 44 ++
script.speedfaninfo/addon.xml | 15 +
script.speedfaninfo/default.py | 275 +++++++
script.speedfaninfo/icon.png | Bin 0 -> 10900 bytes
.../resources/language/English/strings.xml | 13 +
script.speedfaninfo/resources/settings.xml | 7 +
.../skins/Default/720p/speedfaninfo-main.xml | 254 +++++++
.../skins/Default/media/speedfan-icon.png | Bin 0 -> 1604 bytes
.../skins/Default/media/speedfan-list-focus.png | Bin 3047 -> 3047 bytes
.../skins/Default/media/speedfan-list-nofocus.png | Bin 2822 -> 2822 bytes
.../skins/Default/media/speedfan-overlay.png | Bin 0 -> 5699 bytes
.../skins/Default/media/speedfan-panel.png | Bin 0 -> 9979 bytes
.../skins/Default/media/speedfan-scroll_back.png | Bin 0 -> 3332 bytes
.../skins/Default/media/speedfan-scroll_mid.png | Bin 0 -> 3417 bytes
.../skins/Default/media/speedfan-title.png | Bin 0 -> 5077 bytes
.../resources/skins/Default/skin.xml | 13 +
script.speedfaninfo/xlogger.py | 73 ++
service.libraryautoupdate/README.txt | 20 +-
service.libraryautoupdate/addon.xml | 4 +-
service.libraryautoupdate/changelog.txt | 8 +-
service.libraryautoupdate/cronex.py | 352 +++++++++
.../resources/language/English/strings.xml | 14 +-
service.libraryautoupdate/resources/settings.xml | 15 +-
service.libraryautoupdate/service.py | 118 ++-
34 files changed, 3307 insertions(+), 54 deletions(-)
create mode 100644 script.module.t0mm0.common/LICENSE.txt
create mode 100644 script.module.t0mm0.common/addon.xml
create mode 100644 script.module.t0mm0.common/changelog.txt
copy {script.artwork.downloader/resources =>
script.module.t0mm0.common/lib/t0mm0}/__init__.py (100%)
create mode 100644 script.module.t0mm0.common/lib/t0mm0/common/__init__.py
create mode 100644 script.module.t0mm0.common/lib/t0mm0/common/addon.py
create mode 100644 script.module.t0mm0.common/lib/t0mm0/common/net.py
create mode 100644 script.speedfaninfo/CHANGELOG.txt
create mode 100644 script.speedfaninfo/COPYING.txt
create mode 100755 script.speedfaninfo/LICENSE.txt
create mode 100755 script.speedfaninfo/README.txt
create mode 100755 script.speedfaninfo/addon.xml
create mode 100755 script.speedfaninfo/default.py
create mode 100644 script.speedfaninfo/icon.png
create mode 100755 script.speedfaninfo/resources/language/English/strings.xml
create mode 100755 script.speedfaninfo/resources/settings.xml
create mode 100755
script.speedfaninfo/resources/skins/Default/720p/speedfaninfo-main.xml
create mode 100644
script.speedfaninfo/resources/skins/Default/media/speedfan-icon.png
copy
script.cdartmanager/resources/skins/Default/media/cdman-default-list-focus.png
=> script.speedfaninfo/resources/skins/Default/media/speedfan-list-focus.png
(100%)
mode change 100644 => 100755
copy
script.cdartmanager/resources/skins/Default/media/default-list-nofocus.png =>
script.speedfaninfo/resources/skins/Default/media/speedfan-list-nofocus.png
(100%)
mode change 100644 => 100755
create mode 100755
script.speedfaninfo/resources/skins/Default/media/speedfan-overlay.png
create mode 100755
script.speedfaninfo/resources/skins/Default/media/speedfan-panel.png
create mode 100755
script.speedfaninfo/resources/skins/Default/media/speedfan-scroll_back.png
create mode 100755
script.speedfaninfo/resources/skins/Default/media/speedfan-scroll_mid.png
create mode 100644
script.speedfaninfo/resources/skins/Default/media/speedfan-title.png
create mode 100755 script.speedfaninfo/resources/skins/Default/skin.xml
create mode 100644 script.speedfaninfo/xlogger.py
create mode 100644 service.libraryautoupdate/cronex.py
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons