The branch, dharma has been updated
       via  9634d998718053e1b42fb795fa82432486aa172e (commit)
      from  d91ccb5c9b80b186755cf3a93679d4e595b4b787 (commit)

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

commit 9634d998718053e1b42fb795fa82432486aa172e
Author: spiff <[email protected]>
Date:   Sun Mar 18 14:51:38 2012 +0100

    [plugin.audio.sverigesradio] updated to version 0.0.5

diff --git a/plugin.audio.sverigesradio/addon.xml 
b/plugin.audio.sverigesradio/addon.xml
index 8cf1caf..0e21139 100644
--- a/plugin.audio.sverigesradio/addon.xml
+++ b/plugin.audio.sverigesradio/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.audio.sverigesradio"
        name="Sveriges Radio"
-       version="0.0.4"
+       version="0.0.5"
        provider-name="Popeye, Daniel">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/plugin.audio.sverigesradio/default.py 
b/plugin.audio.sverigesradio/default.py
index f946166..00e2330 100644
--- a/plugin.audio.sverigesradio/default.py
+++ b/plugin.audio.sverigesradio/default.py
@@ -14,6 +14,12 @@ BASE_URL = "http://sr.se";
 
 __settings__ = xbmcaddon.Addon(id='plugin.audio.sverigesradio')
 
+QUALITIES = ["low", "normal", "high"]
+PROTOCOLS = ["http", "rtsp"]
+
+SET_QUALITY = QUALITIES[int(__settings__.getSetting("quality"))]
+SET_PROTOCOL = PROTOCOLS[int(__settings__.getSetting("protocol"))]
+
 def list_channels():
     doc, state = load_xml(CHANNEL_URL)
     if doc and not state:
@@ -34,11 +40,11 @@ def list_channels():
                 quality = url.getAttribute("quality")
                 playlist = url.getAttribute("playlist")
                 stream = url.childNodes[0].data
-                if type == "m4a" and quality == "high":
+                if type == "m4a" and quality == SET_QUALITY:
                     if logo:
-                        add_posts(title, stream, description, logo, album = 
originaltitle, artist = 'Sveriges Radio')
+                        add_posts(title, stream, description, logo, isLive = 
'true', album = originaltitle, artist = 'Sveriges Radio')
                     else:
-                        add_posts(title, stream, description, album = 
originaltitle, artist = 'Sveriges Radio')
+                        add_posts(title, stream, description, isLive = 'true', 
album = originaltitle, artist = 'Sveriges Radio')
     else:
         if state == "site":
             xbmc.executebuiltin('Notification("Sveriges Radio","Site down")')
@@ -76,7 +82,7 @@ def list_program(unitid):
             type = url.getAttribute("type")
             protocol = url.getAttribute("protocol")
             quality = url.getAttribute("quality")
-            if type == "m4a" and protocol == "http" and quality == "high":
+            if type == "m4a" and protocol == SET_PROTOCOL and quality == 
SET_QUALITY:
                 base = url.childNodes[0].data
         if base == "":
             base = 
"http://sverigesradio.se/topsy/ljudfil/utan/statistik/[broadcastid].m4a";
@@ -102,8 +108,9 @@ def list_program(unitid):
                     thumb = ''
                 for broadcast in 
ondemand.getElementsByTagName("broadcastfilename"):
                     broadcastid = 
broadcast.getAttribute("broadcastid").encode('utf_8')                           
    
-                    # broadcastname = 
broadcast.childNodes[0].data.encode('utf_8')
+                    broadcastname = 
broadcast.childNodes[0].data.encode('utf_8')
                     url = base.replace("[broadcastid]", broadcastid)
+                    url = url.replace("[broadcastfilename]", broadcastname)
                     add_posts(title, url, description, thumb, artist='Sveriges 
Radio', album=originaltitle)
     else:
         if state == "site":
@@ -113,7 +120,7 @@ def list_program(unitid):
     xbmcplugin.endOfDirectory(HANDLE)
 
 
-def add_posts(title, url, description='', thumb='', isPlayable='true', 
isLive='true', isFolder=False, artist='',\
+def add_posts(title, url, description='', thumb='', isPlayable='true', 
isLive='false', isFolder=False, artist='',\
               album=''):
     title = title.replace("\n", " ")
     listitem=xbmcgui.ListItem(title, iconImage=thumb)

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

Summary of changes:
 plugin.audio.sverigesradio/addon.xml               |    2 +-
 plugin.audio.sverigesradio/default.py              |   19 +++++++++++++------
 .../resources/language/English/strings.xml         |   12 ++++++++++++
 .../resources/language/Swedish/strings.xml         |   12 ++++++++++++
 plugin.audio.sverigesradio/resources/settings.xml  |    7 +++++++
 5 files changed, 45 insertions(+), 7 deletions(-)
 create mode 100644 
plugin.audio.sverigesradio/resources/language/English/strings.xml
 create mode 100644 
plugin.audio.sverigesradio/resources/language/Swedish/strings.xml
 create mode 100644 plugin.audio.sverigesradio/resources/settings.xml


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to