The branch, eden-pre has been updated
       via  abceb108b2a88ab55cefb1602fd2a2f5f5bfc31e (commit)
      from  fc610c3c1f83767a1bd29b7219acb6521f8ef595 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=abceb108b2a88ab55cefb1602fd2a2f5f5bfc31e

commit abceb108b2a88ab55cefb1602fd2a2f5f5bfc31e
Author: amet <[email protected]>
Date:   Tue Jan 17 21:22:58 2012 +0400

    [service.libraryautoupdate] -v 0.4.0
    
    - running video and music scans side by side never really worked. Now 
checks if scan is running and waits until complete before running the next scan.
    
    - Had a user suggestion to allow for a manual launch of the process as well 
as the service. Since the service point will ALWAYS launch on startup the 
manual option will kick off the library update process.

diff --git a/service.libraryautoupdate/addon.xml 
b/service.libraryautoupdate/addon.xml
index 6dac956..c842808 100644
--- a/service.libraryautoupdate/addon.xml
+++ b/service.libraryautoupdate/addon.xml
@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

 <addon id="service.libraryautoupdate"

-    name="XBMC Library Auto Update" version="0.3.9" provider-name="robweber">

+    name="XBMC Library Auto Update" version="0.4.0" provider-name="robweber">

   <requires>

     <import addon="xbmc.python" version="2.0"/>

   </requires>

+  <extension point="xbmc.python.script" library="manual.py"> 

+     <provides>executable</provides> 

+  </extension> 

   <extension point="xbmc.service" library="default.py" start="login">

   </extension>

   <extension point="xbmc.addon.metadata">

diff --git a/service.libraryautoupdate/changelog.txt 
b/service.libraryautoupdate/changelog.txt
index f47d6ff..4f73d9a 100644
--- a/service.libraryautoupdate/changelog.txt
+++ b/service.libraryautoupdate/changelog.txt
@@ -15,4 +15,8 @@
 

 [B]Version 0.3.9[/B]

  

-- running video and music scans side by side never really worked. Now checks 
if scan is running and waits until complete before running the next scan. 
\ No newline at end of file
+- running video and music scans side by side never really worked. Now checks 
if scan is running and waits until complete before running the next scan. 

+

+[B]Version 0.4.0[/B]

+

+- Had a user suggestion to allow for a manual launch of the process as well as 
the service. Since the service point will ALWAYS launch on startup the manual 
option will kick off the library update process. 
\ No newline at end of file
diff --git a/service.libraryautoupdate/default.py 
b/service.libraryautoupdate/default.py
index 349d098..89d21ab 100644
--- a/service.libraryautoupdate/default.py
+++ b/service.libraryautoupdate/default.py
@@ -1,65 +1,6 @@
-import time
-import xbmc
-import xbmcaddon
-                
-class AutoUpdater:             
-    def runProgram(self):
-        Addon = xbmcaddon.Addon(id='service.libraryautoupdate')
-        
-        #set last run to 0 so it will run the first time
-        self.last_run = 0
-        
-        while(not xbmc.abortRequested):
-            now = time.time()
-            sleep_time = 10
-            
-            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 run an update
-            if(now > self.last_run + 
(timer_amounts[Addon.getSetting('timer_amount')] * 60 * 60)):
-
-                #make sure player isn't running
-                if(xbmc.Player().isPlaying() == False):
-                    
-                    if(self.scanRunning() == False):
-                        
-                        #run the update
-                        if(Addon.getSetting('update_video') == 'true'):
-                            xbmc.log('Updating Video')
-                            xbmc.executebuiltin('UpdateLibrary(video)')
-                            time.sleep(1)
-                            
-                        if(Addon.getSetting('update_music') == 'true'):
-                            #check if scan is running again, wait until 
finished if it is
-                            while(self.scanRunning()):
-                                time.sleep(10)
-                            
-                            xbmc.log('Update Music')
-                            xbmc.executebuiltin('UpdateLibrary(music)')
-                        
-                        #reset the last run timer    
-                        self.last_run = now
-                        xbmc.log("Update Library will run again in " + 
str(timer_amounts[Addon.getSetting("timer_amount")]) + " hours")
-                else:
-                    xbmc.log("Player is running, waiting until finished")
-                    
-            #put the thread to sleep for x number of seconds
-            time.sleep(sleep_time)
-            
-    def scanRunning(self):
-        #check if any type of scan is currently running
-        if(xbmc.getCondVisibility('Library.IsScanningVideo') or 
xbmc.getCondVisibility('Library.IsScanningMusic')):
-            return True
-        else:
-            return False
-           
-#run the program
-xbmc.log("Update Library Service starting...")
-AutoUpdater().runProgram()
-
+import xbmc

+from service import AutoUpdater

+

+#run the program

+xbmc.log("Update Library Service starting...")

+AutoUpdater().runProgram()


-----------------------------------------------------------------------

Summary of changes:
 service.libraryautoupdate/addon.xml                |    5 +-
 service.libraryautoupdate/changelog.txt            |    6 ++-
 service.libraryautoupdate/default.py               |   71 ++------------------
 service.libraryautoupdate/manual.py                |    6 ++
 .../{default.py => service.py}                     |   47 +++++++------
 5 files changed, 45 insertions(+), 90 deletions(-)
 create mode 100644 service.libraryautoupdate/manual.py
 copy service.libraryautoupdate/{default.py => service.py} (58%)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to