The branch, frodo has been updated
       via  bdef3ad92d3f6c279a5ff04768eb50b5016dbacb (commit)
       via  ca508a86a6e5d2504bf82382cfac070d88f52c91 (commit)
      from  9b70465c08eb3d19e5f767949b5546036cd2e1d7 (commit)

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

commit bdef3ad92d3f6c279a5ff04768eb50b5016dbacb
Author: Martijn Kaijser <[email protected]>
Date:   Sat Apr 19 10:45:35 2014 +0200

    [plugin.audio.di.fm] 3.0.3

diff --git a/plugin.audio.di.fm/addon.xml b/plugin.audio.di.fm/addon.xml
index ecd4d71..d59ab31 100644
--- a/plugin.audio.di.fm/addon.xml
+++ b/plugin.audio.di.fm/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.audio.di.fm"
        name="Digitally Imported"
-       version="3.0.2"
+       version="3.0.3"
        provider-name="qualisoft.dk - Tim C. Steinmetz">
        <requires>
                <import addon="xbmc.python" version="2.1.0"/>
diff --git a/plugin.audio.di.fm/changelog.txt b/plugin.audio.di.fm/changelog.txt
index d705df8..2d0c295 100644
--- a/plugin.audio.di.fm/changelog.txt
+++ b/plugin.audio.di.fm/changelog.txt
@@ -2,6 +2,10 @@
 * Fixed/improved feature
 - Removed feature
 
+16. April 2014 v3.0.3
+* Rewrote premium login to use api.audioaddict.com - Fixes recent premium 
login issues
+  Thanks to Vidar Waagbø for this fix
+
 
 3. January 2014 v3.0.2
 * Fixed file pathing for the config file as well - DOH!
diff --git a/plugin.audio.di.fm/config.ini b/plugin.audio.di.fm/config.ini
index 3d996c9..9103493 100644
--- a/plugin.audio.di.fm/config.ini
+++ b/plugin.audio.di.fm/config.ini
@@ -12,6 +12,7 @@ cacheChannels       = cacheChannels.json
 frontpage                  = http://www.di.fm
 login               = http://www.di.fm/login
 listenkey          = http://www.di.fm/member/listen_key
+apiAuthenticate     = https://api.audioaddict.com/v1/di/members/authenticate
 
 [streams]
 public = http://listen.di.fm/public2
diff --git a/plugin.audio.di.fm/default.py b/plugin.audio.di.fm/default.py
index 6243abe..4f254c1 100644
--- a/plugin.audio.di.fm/default.py
+++ b/plugin.audio.di.fm/default.py
@@ -164,7 +164,7 @@ class musicAddonXbmc:
 
                 channels = 
json.loads(self.curler.request(pluginConfig.get('streams', 'premium%sk' % 
self.dictBitrate[int(ADDON.getSetting('bitrate'))]), 'get'))
 
-                premiumConfig = self.getPremiumConfig(html)
+                premiumConfig = self.getPremiumConfig()
 
                 # if premiumConfig['listenKey'] is blank, we did not log in 
correctly
                 if premiumConfig['listenKey'] == '':
@@ -380,15 +380,31 @@ class musicAddonXbmc:
     """ Return a list containing a dictonary or false
      Returns the logged in users premium config
     """
-    def getPremiumConfig(self, html):
+    def getPremiumConfig(self):
         try:
             if ADDON.getSetting("forceupdate") == "true":
-                re_config = 
re.compile("NS\('AudioAddict.API'\).Config\s*=\s*([^;]+);", re.M | re.I)
-                pickle.dump(re_config.findall(html)[0], 
open(os.path.join(self.addonProfilePath, pluginConfig.get('cache', 
'cachePremiumConfig')), "w"), protocol=0)
-                premiumConfig = json.loads(re_config.findall(html)[0])
+
+                # Login to api.audioaddict.com to retrieve useful data
+                # Documentation: http://tobiass.eu/api-doc.html#13
+
+                loginData = urllib.urlencode({'username': 
ADDON.getSetting('username'),
+                                              'password': 
ADDON.getSetting('password')})
+                # Download and save response
+                jsonResponse = self.curler.request(pluginConfig.get('urls', 
'apiAuthenticate'), 'post', loginData)
+                jsonData = json.loads(jsonResponse)
+                pickle.dump(jsonData, open(os.path.join(self.addonProfilePath, 
pluginConfig.get('cache', 'cachePremiumConfig')), "w"), protocol=0)
+
+                # Load needed data into premiumConfig
+                premiumConfig = {'listenKey' : jsonData['listen_key']}
+
             else:
-                premiumConfig = 
json.loads(pickle.load(open(os.path.join(self.addonProfilePath, 
pluginConfig.get('cache', 'cachePremiumConfig')), "r")))
+                # Load data from local cache
+
+                jsonData = 
pickle.load(open(os.path.join(self.addonProfilePath, pluginConfig.get('cache', 
'cachePremiumConfig')), "r"))
+                premiumConfig = {'listenKey' : jsonData['listen_key']}
+
             return premiumConfig
+
         except Exception:
             sys.exc_clear() # Clears all exceptions so the script will 
continue to run
             return False

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=ca508a86a6e5d2504bf82382cfac070d88f52c91

commit ca508a86a6e5d2504bf82382cfac070d88f52c91
Author: Martijn Kaijser <[email protected]>
Date:   Sat Apr 19 10:40:38 2014 +0200

    [plugin.program.super.favourites] 1.0.1

diff --git a/plugin.program.super.favourites/addon.xml 
b/plugin.program.super.favourites/addon.xml
index a91cb98..cae811b 100644
--- a/plugin.program.super.favourites/addon.xml
+++ b/plugin.program.super.favourites/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.program.super.favourites" name="Super Favourites" 
version="1.0.0" provider-name="spoyser">
+<addon id="plugin.program.super.favourites" name="Super Favourites" 
version="1.0.1" provider-name="spoyser">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
   </requires>
diff --git a/plugin.program.super.favourites/changelog.txt 
b/plugin.program.super.favourites/changelog.txt
index ed6da29..48acbc4 100644
--- a/plugin.program.super.favourites/changelog.txt
+++ b/plugin.program.super.favourites/changelog.txt
@@ -1,2 +1,5 @@
+v1.0.1:
+  - bug fixes
+
 v1.0.0:
   - initial release
diff --git a/plugin.program.super.favourites/default.py 
b/plugin.program.super.favourites/default.py
index 0802fb4..5d9d83a 100644
--- a/plugin.program.super.favourites/default.py
+++ b/plugin.program.super.favourites/default.py
@@ -60,6 +60,8 @@ _RENAMEFOLDER = 900
 _RENAMEFAVE   = 1000
 _MOVE         = 1100
 _COPY         = 1200
+_UP           = 1300
+_DOWN         = 1400
 
 SHOWNEW  = ADDON.getSetting('SHOWNEW')  == 'true'
 SHOWXBMC = ADDON.getSetting('SHOWXBMC') == 'true'
@@ -77,10 +79,6 @@ def main():
 
     addNewFolderItem(profile)
 
-    if SHOWXBMC:        
-        addDir(GETTEXT(30040), _XBMC, thumbnail='DefaultFolder.png', 
isFolder=True)
-        addSeparatorItem()
-
     parseFolder(profile)
 
 
@@ -144,8 +142,13 @@ def showXBMCFolder():
     parseFile(file, True)
 
 
-def parseFile(file, isXBMC=False):
+def parseFile(file, isXBMC=False, reqSep=False):
     faves = favourite.getFavourites(file)
+
+    if reqSep and len(faves) > 0:
+        addSeparatorItem()
+        
+
     for fave in faves:
         label = fave[0]
         thumb = fave[1]
@@ -153,10 +156,16 @@ def parseFile(file, isXBMC=False):
 
         menu  = []
 
-        include = True #originally set to (not isXBMC)
+        include = True #originally set to (not isXBMC) to prevent altering 
XBMC favourites themselves
+
+        #if include:
+            #menu.append((GETTEXT(30041), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _UP,         
urllib.quote_plus(file), urllib.quote_plus(cmd))))
+            #menu.append((GETTEXT(30042), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _DOWN,       
urllib.quote_plus(file), urllib.quote_plus(cmd))))
+
+        menu.append((GETTEXT(30007), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _COPY,       
urllib.quote_plus(file), urllib.quote_plus(cmd))))
 
-        menu.append((GETTEXT(30007), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _COPY, 
urllib.quote_plus(file), urllib.quote_plus(cmd))))
         if include:
+
             menu.append((GETTEXT(30008), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _MOVE,       
urllib.quote_plus(file), urllib.quote_plus(cmd))))
             menu.append((GETTEXT(30009), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _REMOVEFAVE, 
urllib.quote_plus(file), urllib.quote_plus(cmd))))
             menu.append((GETTEXT(30010), 
'XBMC.RunPlugin(%s?mode=%d&file=%s&cmd=%s)' % (sys.argv[0], _RENAMEFAVE, 
urllib.quote_plus(file), urllib.quote_plus(cmd))))
@@ -167,9 +176,21 @@ def parseFile(file, isXBMC=False):
 
 
 def parseFolder(folder):
+    if SHOWXBMC:        
+        addDir(GETTEXT(30040), _XBMC, thumbnail='DefaultFolder.png', 
isFolder=True)
+
     try:    current, dirs, files = os.walk(folder).next()
     except: return
 
+    nmrDirs = len(dirs)
+    reqSep  = nmrDirs > 0
+
+    if SHOWXBMC:
+        if reqSep:
+            addSeparatorItem()
+        else:
+            reqSep = True
+
     for dir in dirs:
         path = os.path.join(current, dir)
         menu = []
@@ -178,14 +199,8 @@ def parseFolder(folder):
 
         addDir(dir,  _FOLDER, path=path, thumbnail=ICON, isFolder=True, 
menu=menu)
 
-    file  = os.path.join(folder, FILENAME)
-
-    nmrDirs = len(dirs)
-
-    if nmrDirs > 0:
-        addSeparatorItem()
-
-    nmrFaves = parseFile(file)
+    file     = os.path.join(folder, FILENAME)
+    nmrFaves = parseFile(file, reqSep=reqSep)
 
     if nmrDirs == 0 and nmrFaves == 0 and not SHOWNEW:
         if not (SHOWXBMC and mode == -1):
@@ -229,7 +244,7 @@ def createNewFolder(current):
         utils.DialogOK('', GETTEXT(30014) % text)
         return
 
-    os.mkdir(folder)
+    os.mkdir(xbmc.translatePath(folder))
     refresh()
 
 
@@ -268,6 +283,10 @@ def findFave(file, cmd):
     return None
 
 
+def shiftFave(file, cmd, up):
+    return True
+
+
 def copyFave(file, cmd, move=False):
     copy = findFave(file, cmd)
     if not copy:
@@ -328,13 +347,13 @@ def playCommand(cmd):
         cmd = cmd.replace('&quot;', '')
         cmd = cmd.replace('&amp;', '&')
 
-        #if 'ActivateWindow' in cmd:
-        #    return activateWindowCommand(cmd)
+        if 'ActivateWindow' in cmd:
+            return activateWindowCommand(cmd)
 
         #workaraound bug in Frodo that can cause lock-up
         #when running a script favourite
-        #if not GOTHAM and 'RunScript' in cmd:
-        #    xbmc.executebuiltin('ActivateWindow(Home)')
+        if not GOTHAM and 'RunScript' in cmd:
+            xbmc.executebuiltin('ActivateWindow(Home)')
 
         xbmc.executebuiltin(cmd)
     except:
@@ -452,6 +471,17 @@ elif mode == _COPY:
     if copyFave(file, cmd):
         refresh()
 
+elif mode == _UP:
+    file = urllib.unquote_plus(params['file'])
+    cmd  = urllib.unquote_plus(params['cmd'])
+    if shiftFave(file, cmd, up=True):
+        refresh()
+
+elif mode == _DOWN:
+    file = urllib.unquote_plus(params['file'])
+    cmd  = urllib.unquote_plus(params['cmd'])
+    if shiftFave(file, cmd, up=False):
+        refresh()
 
 elif mode == _REMOVEFAVE:
     file = urllib.unquote_plus(params['file'])
diff --git a/plugin.program.super.favourites/fanart.jpg 
b/plugin.program.super.favourites/fanart.jpg
index 4f229bd..688a4c4 100644
Binary files a/plugin.program.super.favourites/fanart.jpg and 
b/plugin.program.super.favourites/fanart.jpg differ
diff --git 
a/plugin.program.super.favourites/resources/language/English/strings.xml 
b/plugin.program.super.favourites/resources/language/English/strings.xml
index 41a3282..e885006 100644
--- a/plugin.program.super.favourites/resources/language/English/strings.xml
+++ b/plugin.program.super.favourites/resources/language/English/strings.xml
@@ -38,4 +38,6 @@
        <string id="30038">F11</string>
        <string id="30039">F12</string> 
        <string id="30040">XBMC Favourites</string>     
+       <string id="30041">Move up</string>     
+       <string id="30042">Move down</string>   
 </strings>
\ No newline at end of file
diff --git a/plugin.program.super.favourites/resources/settings.xml 
b/plugin.program.super.favourites/resources/settings.xml
index a38f5de..072e1b4 100644
--- a/plugin.program.super.favourites/resources/settings.xml
+++ b/plugin.program.super.favourites/resources/settings.xml
@@ -3,7 +3,7 @@
        <category label="30022">        
                <setting id="SHOWNEW"  label="30023" type="bool"      
default="true" />
                <setting id="SHOWXBMC" label="30024" type="bool"      
default="true" />
-        <setting id="HOTKEY"   label="30026" type="labelenum" default="F1" 
lvalues="30027|30028|30029|30030|30031|30032|30033|30034|30035|30036|30037|30038|30039"/>
           
+        <setting id="HOTKEY"   label="30026" type="labelenum" 
lvalues="30027|30028|30029|30030|30031|30032|30033|30034|30035|30036|30037|30038|30039"/>
                
                
                <setting id="VERSION" type="text" label="" default="0.0.0" 
visible="false"/>
        </category>
diff --git a/plugin.program.super.favourites/utils.py 
b/plugin.program.super.favourites/utils.py
index 740db94..d1ce257 100644
--- a/plugin.program.super.favourites/utils.py
+++ b/plugin.program.super.favourites/utils.py
@@ -36,7 +36,7 @@ ADDONID = 'plugin.program.super.favourites'
 ADDON   =  xbmcaddon.Addon(ADDONID)
 HOME    =  ADDON.getAddonInfo('path')
 PROFILE =  os.path.join(ADDON.getAddonInfo('profile'), 'Super Favourites')
-VERSION = '1.0.0'
+VERSION = '1.0.1'
 ICON    =  os.path.join(HOME, 'icon.png')
 FANART  =  os.path.join(HOME, 'fanart.jpg')
 BLANK   =  os.path.join(HOME, 'resources', 'media', 'blank.png')
@@ -72,7 +72,12 @@ def CheckVersion():
 
     ADDON.setSetting('VERSION', curr)
 
-    if prev == '0.0.0':
+    if prev == '0.0.0' or prev== '1.0.0':
+
+        folder  = xbmc.translatePath(PROFILE)
+        if not os.path.isdir(folder):
+            os.makedirs(folder) 
+
         VerifyKeymap()
         
 

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

Summary of changes:
 plugin.audio.di.fm/addon.xml                       |    2 +-
 plugin.audio.di.fm/changelog.txt                   |    4 +
 plugin.audio.di.fm/config.ini                      |    1 +
 plugin.audio.di.fm/default.py                      |   28 ++++++--
 plugin.program.super.favourites/addon.xml          |    2 +-
 plugin.program.super.favourites/changelog.txt      |    3 +
 plugin.program.super.favourites/default.py         |   70 ++++++++++++++------
 plugin.program.super.favourites/fanart.jpg         |  Bin 388889 -> 147987 
bytes
 .../resources/language/English/strings.xml         |    2 +
 .../resources/settings.xml                         |    2 +-
 plugin.program.super.favourites/utils.py           |    9 ++-
 11 files changed, 92 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to