The branch, gotham has been updated
       via  0776536e129bbbd9b911d83aa37e53eb00d2f5a8 (commit)
      from  35443f445ebe529027910a70b73cd0c6686424b3 (commit)

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

commit 0776536e129bbbd9b911d83aa37e53eb00d2f5a8
Author: Martijn Kaijser <mcm.kaij...@gmail.com>
Date:   Sat Jun 14 11:31:36 2014 +0200

    [plugin.video.svtplay] 4.0.2

diff --git a/plugin.video.svtplay/addon.xml b/plugin.video.svtplay/addon.xml
index 82a2191..56ab854 100644
--- a/plugin.video.svtplay/addon.xml
+++ b/plugin.video.svtplay/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.svtplay"
        name="SVT Play"
-       version="4.0.1"
+       version="4.0.2"
        provider-name="nilzen">
   <requires>
     <import addon="script.module.parsedom" version="1.2.0"/>
diff --git a/plugin.video.svtplay/changelog.txt 
b/plugin.video.svtplay/changelog.txt
index 6b124af..2237c23 100644
--- a/plugin.video.svtplay/changelog.txt
+++ b/plugin.video.svtplay/changelog.txt
@@ -1,3 +1,8 @@
+Version 4.0.2
+-------------
+- Fix broken A-Ö listing
+- Fix live broadcasts
+
 Version 4.0.1
 -------------
 - Fix broken news category listing
diff --git a/plugin.video.svtplay/default.py b/plugin.video.svtplay/default.py
index 7625a27..711ceee 100644
--- a/plugin.video.svtplay/default.py
+++ b/plugin.video.svtplay/default.py
@@ -19,7 +19,7 @@ MODE_CHANNELS = "kanaler"
 MODE_A_TO_O = "a-o"
 MODE_PROGRAM = "pr"
 MODE_CLIPS = "clips"
-MODE_LIVE_CHANNELS = "live-channels"
+MODE_LIVE_PROGRAMS = "live-channels"
 MODE_LATEST = "ep"
 MODE_LATEST_NEWS = "en"
 MODE_POPULAR = "popular"
@@ -57,7 +57,7 @@ def viewStart():
   addDirectoryItem(localize(30009), { "mode": MODE_POPULAR })
   addDirectoryItem(localize(30003), { "mode": MODE_LATEST })
   addDirectoryItem(localize(30010), { "mode": MODE_LAST_CHANCE })
-  addDirectoryItem(localize(30002), { "mode": MODE_LIVE_CHANNELS })
+  addDirectoryItem(localize(30002), { "mode": MODE_LIVE_PROGRAMS })
   addDirectoryItem(localize(30008), { "mode": MODE_CHANNELS })
   addDirectoryItem(localize(30000), { "mode": MODE_A_TO_O })
   addDirectoryItem(localize(30001), { "mode": MODE_CATEGORIES })
@@ -120,8 +120,8 @@ def viewLastChance():
   for article in articles:
     createDirItem(article, MODE_VIDEO)
 
-def viewLiveChannels():
-  articles = svt.getLiveChannels()
+def viewLivePrograms():
+  articles = svt.getLivePrograms()
   if not articles:
     return
   for article in articles:
@@ -343,8 +343,8 @@ elif ARG_MODE == MODE_POPULAR:
   viewPopular()
 elif ARG_MODE == MODE_LAST_CHANCE:
   viewLastChance()
-elif ARG_MODE == MODE_LIVE_CHANNELS:
-  viewLiveChannels()
+elif ARG_MODE == MODE_LIVE_PROGRAMS:
+  viewLivePrograms()
 elif ARG_MODE == MODE_CHANNELS:
   viewChannels()
 elif ARG_MODE == MODE_LETTER:
diff --git a/plugin.video.svtplay/resources/lib/svt.py 
b/plugin.video.svtplay/resources/lib/svt.py
index 1f5f421..75f472a 100644
--- a/plugin.video.svtplay/resources/lib/svt.py
+++ b/plugin.video.svtplay/resources/lib/svt.py
@@ -18,7 +18,7 @@ SECTION_LATEST_VIDEOS = "latest-videos"
 SECTION_LAST_CHANCE = "last-chance-videos"
 SECTION_LATEST_CLIPS = "playJs-more-clips"
 SECTION_EPISODES = "playJs-more-episodes"
-SECTION_LIVE_CHANNELS = "live-channels"
+SECTION_LIVE_PROGRAMS = "live-channels"
 
 SEARCH_LIST_TITLES = "[^\"']*playJs-search-titles[^\"']*"
 SEARCH_LIST_EPISODES = "[^\"']*playJs-search-episodes[^\"']*"
@@ -110,7 +110,7 @@ def getAlphas():
   Returns a list of all letters in the alphabet that has programs.
   """
   html = getPage(URL_A_TO_O)
-  container = common.parseDOM(html, "div", attrs = { "class" : 
"[^\"']*play_alphabetic-list-titles[^\"']*" })
+  container = common.parseDOM(html, "ul", attrs = { "class" : 
"[^\"']*play_alphabetic-list-titles[^\"']*" })
 
   if not container:
     common.log("No container found!")
@@ -141,7 +141,11 @@ def getProgramsByLetter(letter):
 
   html = getPage(URL_A_TO_O)
 
-  letterboxes = common.parseDOM(html, "div", attrs = { "class": 
"[^\"']*play_alphabetic-letter[^\"']*" })
+  letterboxes = common.parseDOM(html, "li", attrs = { "class": 
"[^\"']*play_alphabetic-letter[^\"']*" })
+  if not letterboxes:
+    common.log("No containers found for letter '%s'" % letter)
+    return None
+
   letterbox = None
 
   for letterbox in letterboxes:
@@ -265,11 +269,11 @@ def getLastChance():
   """
   return getArticles(SECTION_LAST_CHANCE)
 
-def getLiveChannels():
+def getLivePrograms():
   """
   Returns the 'live' channels (differs from 'channels')
   """
-  return getArticles(SECTION_LIVE_CHANNELS)
+  return getArticles(SECTION_LIVE_PROGRAMS)
 
 def getEpisodes(url):
   """
@@ -330,8 +334,8 @@ def getArticles(section_name, url=None):
                                 attrs = { "class": 
"[^\"']*play_videolist__thumbnail[^\"']*" },
                                 ret = "src")[0]
     new_article["thumbnail"] = helper.prepareThumb(thumbnail, baseUrl=BASE_URL)
-    if section_name == SECTION_LIVE_CHANNELS:
-      notlive = common.parseDOM(article, "span", attrs = {"class": 
"[^\"']*play_icon-live[^\"']*is-inactive[^\"']*"})
+    if section_name == SECTION_LIVE_PROGRAMS:
+      notlive = common.parseDOM(article, "span", attrs = {"class": 
"[^\"']*play_graphics-live[^\"']*is-inactive[^\"']*"})
       if notlive:
         new_article["live"] = False
       else:
diff --git a/plugin.video.svtplay/tests/testSvt.py 
b/plugin.video.svtplay/tests/testSvt.py
index f87a951..4066500 100644
--- a/plugin.video.svtplay/tests/testSvt.py
+++ b/plugin.video.svtplay/tests/testSvt.py
@@ -24,8 +24,7 @@ class TestSvtModule(unittest.TestCase):
   def test_alphabetic(self):
     programs = svt.getAtoO()
 
-    self.assertIsNotNone(programs)
-    self.assertNotEqual([], programs)
+    self.assertHasContent(programs)
 
     for program in programs:
       for key in program.keys():
@@ -57,7 +56,7 @@ class TestSvtModule(unittest.TestCase):
 
     alphas = svt.getAlphas()
 
-    self.assertNotEqual([], alphas)
+    self.assertHasContent(alphas)
 
   def test_programs_by_letter(self):
 
@@ -98,8 +97,8 @@ class TestSvtModule(unittest.TestCase):
 
     self.assertHasContent(items)
 
-  def test_get_live_channels(self):
-    items = svt.getLiveChannels()
+  def test_get_live_programs(self):
+    items = svt.getLivePrograms()
 
     self.assertHasContent(items)
 

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

Summary of changes:
 plugin.video.svtplay/addon.xml            |    2 +-
 plugin.video.svtplay/changelog.txt        |    5 +++++
 plugin.video.svtplay/default.py           |   12 ++++++------
 plugin.video.svtplay/resources/lib/svt.py |   18 +++++++++++-------
 plugin.video.svtplay/tests/testSvt.py     |    9 ++++-----
 5 files changed, 27 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to