The branch, dharma has been updated
       via  0d0bd496f6c2cb5fa32edefb05f888048afc4e48 (commit)
      from  dd69ea7b06662aa0b7ce724a6b21ed5c657982d1 (commit)

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

commit 0d0bd496f6c2cb5fa32edefb05f888048afc4e48
Author: Zeljko Ametovic <[email protected]>
Date:   Sun Dec 12 14:29:36 2010 +0400

    [script.trakt] -v 0.0.9
    - adjusted time intervals to be more aggressive if video is not playing
    - corrected bug in title checking

diff --git a/script.trakt/addon.xml b/script.trakt/addon.xml
index f4bc6ed..f28dafc 100644
--- a/script.trakt/addon.xml
+++ b/script.trakt/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.trakt"
        name="trakt"
-       version="0.0.8"
+       version="0.0.9"
        provider-name="rudf0rd">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/script.trakt/changelog.txt b/script.trakt/changelog.txt
index c04a5c9..b01b4cc 100644
--- a/script.trakt/changelog.txt
+++ b/script.trakt/changelog.txt
@@ -1,3 +1,7 @@
+Version 0.0.9
+       - adjusted time intervals to be more aggressive if video is not playing
+       - corrected bug in title checking
+
 Version 0.0.8
        - added Dutch translation thanks to IIINeOIIINL!
        - fixed bug sending movie data (still pre-emptive, but coming soon)
diff --git a/script.trakt/default.py b/script.trakt/default.py
index cd3f305..222a5b9 100644
--- a/script.trakt/default.py
+++ b/script.trakt/default.py
@@ -12,7 +12,7 @@ import re
 __scriptname__ = "trakt"
 __author__ = "Sean Rudford"
 __url__ = "http://trakt.tv/";
-__version__ = "0.0.8"
+__version__ = "0.0.9"
 __XBMC_Revision__ = ""
 
 def addPadding(number):
@@ -35,12 +35,15 @@ def CheckAndSubmit(Manual=False):
         global lasttitle
         global lastUpdate
         global video_id
+        global sleepTime
+        global checkTitle
         
         iPercComp = 
CalcPercentageRemaining(xbmc.getInfoLabel("VideoPlayer.Time"), 
xbmc.getInfoLabel("VideoPlayer.Duration"))
-        
-        if iPercComp > (float(VideoThreshold) / 100) or lastUpdate == 0:
+
+        if iPercComp > (float(VideoThreshold) / 100) or lastUpdate == 0 or 
checkTitle != xbmc.getInfoLabel("VideoPlayer.Title"):
             # do nothing and let it continue to main script
-            Debug("continuing to main script")
+            lastUpdate = 0
+            Debug("continuing to send check")
         elif (time.time() - lastUpdate < 900):
             return
         
@@ -115,14 +118,19 @@ def CheckAndSubmit(Manual=False):
                 Debug('Title: ' + title + ', sending watched status, current 
percentage: ' + str(iPercComp), True)
                 SendUpdate(title+","+video_id, int(iPercComp*100), sType, 
"watched")
                 lasttitle = title
+                checkTitle = xbmc.getInfoLabel("VideoPlayer.Title")
+                sleepTime = 15
             elif (time.time() - lastUpdate >= 900):
                 Debug('Title: ' + title + ', sending watching status, current 
percentage: ' + str(iPercComp), True)
                 SendUpdate(title+","+video_id, int(iPercComp*100), sType, 
"watching")
                 lastUpdate = time.time();
+                checkTitle = xbmc.getInfoLabel("VideoPlayer.Title")
+                sleepTime = 168
     
     else:
         Debug('Resetting last update timestamp')
         lastUpdate = 0
+        sleepTime = 15
         getID = True
 
 
@@ -182,6 +190,8 @@ lasttitle = ""
 lastUpdate = 0
 video_id = ""
 getID = True
+sleepTime = 168
+checkTitle = ''
 
 bAutoStart = False
 bNotify = False
@@ -235,6 +245,6 @@ if ((bStartup and bAutoStart) or bRun):
         if (bAutoSubmitVideo):
             CheckAndSubmit()
 
-        time.sleep(168)
+        time.sleep(sleepTime)
 
 Debug( 'Exiting...', False)
diff --git a/script.trakt/resources/lib/utilities.py 
b/script.trakt/resources/lib/utilities.py
index dfa7248..1bba96e 100644
--- a/script.trakt/resources/lib/utilities.py
+++ b/script.trakt/resources/lib/utilities.py
@@ -18,7 +18,7 @@ except ImportError:
 

 __settings__ = xbmcaddon.Addon(id='script.trakt')

 __language__ = __settings__.getLocalizedString

-__version__ = "0.0.8"

+__version__ = "0.0.9"

 __cwd__ = __settings__.getAddonInfo('path')

 

 #Path handling


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

Summary of changes:
 script.trakt/addon.xml                  |    2 +-
 script.trakt/changelog.txt              |    4 ++++
 script.trakt/default.py                 |   20 +++++++++++++++-----
 script.trakt/resources/lib/utilities.py |    2 +-
 4 files changed, 21 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to