The branch, eden has been updated
       via  978e0fa3ff66c8423f140c019cc1d47be52a3ef2 (commit)
      from  c1037ae6f39fc254ba2e88cb632f11a39205fe98 (commit)

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

commit 978e0fa3ff66c8423f140c019cc1d47be52a3ef2
Author: spiff <[email protected]>
Date:   Fri Mar 23 13:43:32 2012 +0100

    [plugin.video.bliptv] updated to version 0.4.0

diff --git a/plugin.video.bliptv/BlipTVNavigation.py 
b/plugin.video.bliptv/BlipTVNavigation.py
index 30094f3..14d8066 100644
--- a/plugin.video.bliptv/BlipTVNavigation.py
+++ b/plugin.video.bliptv/BlipTVNavigation.py
@@ -40,22 +40,22 @@ class BlipTVNavigation:
         # This list contains the main menu structure the user first encounters 
when running the plugin
         #                           label                                      
            , path                                                              
                  , thumbnail                                        ,  scraper 
/ action
         self. categories = (
-            {'Title':self.language(30016)  ,'path':"/root/explore"             
                                            , 'thumbnail':"explore"             
   },
-            {'Title':self.language(30001)  ,'path':"/root/explore/browse"      
                                  , 'thumbnail':"explore"                , 
'scraper': 'browse_shows' },
-            {'Title':self.language(30002)  ,'path':"/root/explore/staffpicks"  
                              , 'thumbnail':"explore"                , 
'scraper': 'staff_picks' },
-            {'Title':self.language(30003)  ,'path':"/root/explore/favorites"   
                             , 'thumbnail':"explore"                , 
'scraper': 'favorites' },
-            {'Title':self.language(30004)  ,'path':"/root/explore/newshows"    
                                    , 'thumbnail':"explore"                , 
'scraper': 'new_shows' },
-            {'Title':self.language(30005)  
,'path':"/root/explore/popularshows"                                , 
'thumbnail':"explore"                , 'scraper': 'popular_shows' },
-            {'Title':self.language(30006)  
,'path':"/root/explore/trendingshow"                                , 
'thumbnail':"explore"                , 'scraper': 'trending_shows' },
-            {'Title':self.language(30007)  ,'path':"/root/explore/newepisodes" 
                               , 'thumbnail':"explore"                , 
'scraper': 'new_episodes' },
-            {'Title':self.language(30008)  
,'path':"/root/explore/popularepisodes"                        , 
'thumbnail':"explore"                , 'scraper': 'popular_episodes' },
-            {'Title':self.language(30009)  
,'path':"/root/explore/trendingepisodes"                        , 
'thumbnail':"explore"                , 'scraper': 'trending_episodes' },
-            {'Title':self.language(30010)  ,'path':"/root/my_favorites"        
                                        , 'thumbnail':"explore"                
, 'store':   'favorites', 'folder':"true" },
-            {'Title':self.language(30011)  ,'path':"/root/my_favorites/search" 
                               , 'thumbnail':"search"                , 
'scraper': 'show_search', 'folder':"true" },
-            {'Title':self.language(30012)  ,'path':"/root/downloads"           
                                     , 'thumbnail':"downloads"        , 'feed': 
   'downloads' },
-            {'Title':self.language(30013)  ,'path':"/root/search"              
                                          , 'thumbnail':"search"                
, 'store':"searches", 'folder':'true' },
-            {'Title':self.language(30014)  ,'path':"/root/search/new"          
                                      , 'thumbnail':"search"                , 
'scraper': 'search'},                                  
-            {'Title':self.language(30015)  ,'path':"/root/settings"            
                                              , 'thumbnail':"settings"        , 
'action':"settings" }
+            {'Title':self.language(30016)  ,'path':"/root/explore"             
            , 'thumbnail':"explore"                },
+            {'Title':self.language(30001)  ,'path':"/root/explore/browse"      
            , 'thumbnail':"explore"                , 'scraper': 'browse_shows' 
},
+            {'Title':self.language(30002)  ,'path':"/root/explore/staffpicks"  
            , 'thumbnail':"explore"                , 'scraper': 'staff_picks' },
+            {'Title':self.language(30003)  ,'path':"/root/explore/favorites"   
            , 'thumbnail':"explore"                , 'scraper': 'favorites' },
+            {'Title':self.language(30004)  ,'path':"/root/explore/newshows"    
            , 'thumbnail':"explore"                , 'scraper': 'new_shows' },
+            {'Title':self.language(30005)  
,'path':"/root/explore/popularshows"            , 'thumbnail':"explore"         
       , 'scraper': 'popular_shows' },
+            {'Title':self.language(30006)  
,'path':"/root/explore/trendingshow"            , 'thumbnail':"explore"         
       , 'scraper': 'trending_shows' },
+            {'Title':self.language(30007)  ,'path':"/root/explore/newepisodes" 
            , 'thumbnail':"explore"                , 'scraper': 'new_episodes' 
},
+            {'Title':self.language(30008)  
,'path':"/root/explore/popularepisodes"         , 'thumbnail':"explore"         
       , 'scraper': 'popular_episodes' },
+            {'Title':self.language(30009)  
,'path':"/root/explore/trendingepisodes"        , 'thumbnail':"explore"         
       , 'scraper': 'trending_episodes' },
+            {'Title':self.language(30010)  ,'path':"/root/my_favorites"        
            , 'thumbnail':"explore"                , 'store': 'favorites', 
'folder':"true" },
+            {'Title':self.language(30011)  ,'path':"/root/my_favorites/search" 
            , 'thumbnail':"search"                 , 'scraper': 'show_search', 
'folder':"true" },
+            {'Title':self.language(30012)  ,'path':"/root/downloads"           
            , 'thumbnail':"downloads"              , 'feed': 'downloads' },
+            {'Title':self.language(30013)  ,'path':"/root/search"              
            , 'thumbnail':"search"                 , 'store':"searches", 
'folder':'true' },
+            {'Title':self.language(30014)  ,'path':"/root/search/new"          
            , 'thumbnail':"search"                 , 'scraper': 'search'},
+            {'Title':self.language(30015)  ,'path':"/root/settings"            
            , 'thumbnail':"settings"               , 'action':"settings" }
                                  )
 
     #==================================== Main Entry 
Points===========================================
@@ -132,15 +132,15 @@ class BlipTVNavigation:
                         return False
                 params["search"] = query
 
-                self.storage.saveSearch(params)
+            self.storage.saveSearch(params)
 
         if get("scraper"):
             results = self.scraper.scrape(params)
         elif get("store"):
             results = self.storage.list(params)
 
-        if len(results) > 0:
-            if get("folder"):
+        if len(results) > 0 or (get("store") and not get("scraper")):
+            if get("folder", "false") != "false":
                 self.common.log("found folder list")
                 self.parseFolderList(params, results)
             else:
@@ -148,24 +148,28 @@ class BlipTVNavigation:
                 self.parseVideoList(params, results)
             return True
         else:
-            label = ""
+            self.showListingError(params)
 
-            for category in self.categories:
-                cat_get = category.get
-                if (
-                    (get("feed") and cat_get("feed") == get("feed")) or
-                    (get("scraper") and cat_get("scraper") == get("scraper"))
-                    ):
-                    label = cat_get("Title")
-
-                if label:
-                    self.utils.showMessage(label, self.language(30601))
         return False
+
+    def showListingError(self, params):
+        get = params.get
+        label = ""
+        for category in self.categories:
+            cat_get = category.get
+            if (
+                (get("feed") and cat_get("feed") == get("feed")) or
+                (get("scraper") and cat_get("scraper") == get("scraper"))
+                ):
+                label = cat_get("Title")
+
+            if label:
+                self.utils.showMessage(label, self.language(30601))
+
     #================================== List Item manipulation 
=========================================
     # is only used by List Menu
     def addListItem(self, params={}, item_params={}):
         self.common.log("")
-        # get = params.get
         item = item_params.get
 
         if item("action") == "play_video":
@@ -177,8 +181,7 @@ class BlipTVNavigation:
 
     # common function for adding folder items
     def addFolderListItem(self, params={}, item_params={}, size=0):
-        # self.common.log("")
-        # get = params.get
+        self.common.log("")
         item = item_params.get
 
         icon = "DefaultFolder.png"
@@ -299,8 +302,6 @@ class BlipTVNavigation:
 
         title = self.common.makeAscii(item("Title", "Unknown Title"))
         url_title = urllib.quote_plus(title)
-        # studio = self.common.makeAscii(item("Studio", "Unknown Author"))
-        # url_studio = urllib.quote_plus(studio)
 
         cm.append((self.language(30504), "XBMC.Action(Queue)",))
 
diff --git a/plugin.video.bliptv/BlipTVScraper.py 
b/plugin.video.bliptv/BlipTVScraper.py
index 04c6201..68d03fd 100644
--- a/plugin.video.bliptv/BlipTVScraper.py
+++ b/plugin.video.bliptv/BlipTVScraper.py
@@ -68,15 +68,12 @@ class BlipTVScraper:
 
             dom_pages = self.common.parseDOM(result["content"], "div", 
{"class": "ShowFlipcard"})
 
-            self.common.log("found items " + repr(dom_pages))
+            self.common.log("found items " + repr(dom_pages), 4)
             for item in dom_pages:
-                thumbnail = self.common.parseDOM(item, "img", attrs={"class": 
"ShowPoster"}, ret="src")
-                name = self.common.parseDOM(item, "a", attrs={"class": "Name"})
-                link = self.common.parseDOM(item, "a", attrs={"class": 
"Name"}, ret="href")
-                print repr(link)
-                link = link[0]
-                print repr(link)
-                tmp.append({"path": get("path"), "show": link, "scraper": 
"show", "Title": self.common.replaceHTMLCodes(name[0].strip()), "thumbnail": 
thumbnail[0]})
+                thumbnail = self.common.parseDOM(item, "img", attrs={"class": 
"ShowPoster"}, ret="src")[0]
+                name = self.common.parseDOM(item, "a", attrs={"class": 
"Name"})[0]
+                link = self.common.parseDOM(item, "a", attrs={"class": 
"Name"}, ret="href")[0]
+                tmp.append({"path": get("path"), "show": link, "scraper": 
"show", "Title": self.common.replaceHTMLCodes(name.strip()), "thumbnail": 
thumbnail})
 
             if len(tmp) > 0 and page < 50:
                 items += tmp
@@ -341,6 +338,8 @@ class BlipTVScraper:
                 continue
 
             for episode in lst:
+                episode = episode.replace("\t","")
+
                 id = self.common.parseDOM(episode, "a", attrs={"class": 
"ArchiveCard"}, ret="href")
                 image = self.common.parseDOM(episode, "img", ret="src")
                 title = self.common.parseDOM(episode, "span", attrs={"class": 
"Title"}, ret="title")
diff --git a/plugin.video.bliptv/BlipTVStorage.py 
b/plugin.video.bliptv/BlipTVStorage.py
index 361aac2..1db1f24 100644
--- a/plugin.video.bliptv/BlipTVStorage.py
+++ b/plugin.video.bliptv/BlipTVStorage.py
@@ -28,9 +28,6 @@ class BlipTVStorage():
         self.utils = sys.modules["__main__"].utils
         self.xbmc = sys.modules["__main__"].xbmc
 
-    # This list contains the list options a user sees when indexing a contact
-    #                                label                                     
     , external                 , login                 ,        thumbnail      
                                  , feed
-
     def list(self, params={}):
         self.common.log("")
         get = params.get
@@ -42,8 +39,8 @@ class BlipTVStorage():
     def deleteFromMyFavoriteShows(self, params):
         self.common.log("")
         get = params.get
-        params["store"] = "favorites"
 
+        params["store"] = "favorites"
         favorites = self.retrieve(params)
 
         for count, favorite in enumerate(favorites):
@@ -57,9 +54,10 @@ class BlipTVStorage():
 
     def addToMyFavoritesShow(self, params={}, item={}):
         self.common.log("")
-        params["store"] = "favorites"
 
+        params["store"] = "favorites"
         favorites = self.retrieve(params)
+
         favorites.append(item)
         favorites = sorted(favorites, key=lambda k: k['Title'])
 
@@ -69,22 +67,8 @@ class BlipTVStorage():
     def getStoredSearches(self, params={}):
         self.common.log(repr(params))
         get = params.get
-        key = self.getStorageKey(params)
-        author_key = self.getStorageKey({"store": "searches_author"})
-        searches = []
-        authors = {}
-
-        try:
-            searches = eval(self.retrieveValue(key))
-        except:
-            searches = self.retrieveValue(key)
-            self.common.log("failed to retrieve stored searches1: " + 
repr(searches))
-            searches = []
-
-        try:
-            authors = eval(self.retrieveValue(author_key))
-        except:
-            self.common.log("failed to retrieve stored searches2: " + 
repr(searches))
+
+        searches = self.retrieve(params)
 
         result = []
         for search in searches:
@@ -97,16 +81,16 @@ class BlipTVStorage():
                 item["feed"] = "search"
                 item["icon"] = "search"
                 item["scraper"] = "search"
-                if search in authors:
-                    item["refined"] = "true"
 
-            params["thumb"] = "true"
+            thumbnail = self.retrieve(params, "thumbnail", item)
+            if thumbnail:
+                item["thumbnail"] = thumbnail
+            else:
+                item["thumbnail"] = item["icon"]
 
-            item["thumbnail"] = self.retrieve(params, "thumbnail", item)
             result.append(item)
 
-        self.common.log("failed to retrieve stored searches3 : " + 
repr(result))
-
+        self.common.log("Done: " + repr(result), 5)
         return result
 
     def deleteStoredSearch(self, params={}):
@@ -114,21 +98,16 @@ class BlipTVStorage():
         get = params.get
         params["store"] = "searches"
 
-        key = self.getStorageKey(params)
         query = urllib.unquote_plus(get("delete"))
 
-        searches = []
-        try:
-            searches = eval(self.retrieveValue(key))
-        except:
-            self.common.log("failed to retrieve stored searches")
+        searches = self.retrieve(params)
 
         for count, search in enumerate(searches):
             if (search.lower() == query.lower()):
                 del(searches[count])
                 break
 
-        self.storeValue(key, repr(searches))
+        self.store(params, searches)
 
         self.xbmc.executebuiltin("Container.Refresh")
 
@@ -136,32 +115,26 @@ class BlipTVStorage():
         self.common.log("")
         get = params.get
 
-        searches = []
-
-        if get("search"):
+        if get("search") and get("scraper") == "search":
             params["store"] = "searches"
 
-            key = self.getStorageKey(params)
+            searches = self.retrieve(params)
 
             new_query = urllib.unquote_plus(get("search"))
             old_query = new_query
 
             if get("old_search"):
                 old_query = urllib.unquote_plus(get("old_search"))
-            try:
-                searches = eval(self.retrieveValue(key))
-            except:
-                self.common.log("failed to retrieve stored searches")
 
             for count, search in enumerate(searches):
                 if (search.lower() == old_query.lower()):
                     del(searches[count])
                     break
 
-            del params["store"]
-            searchCount = (10, 20, 30, 
40)[int(self.settings.getSetting("saved_searches" ))]
+            searchCount = (10, 20, 30, 
40)[int(self.settings.getSetting("saved_searches"))]
             searches = [new_query] + searches[:searchCount]
-            self.storeValue(key, repr(searches))
+            self.store(params, searches)
+            del params["store"]
 
     def editStoredSearch(self, params={}):
         self.common.log("")
@@ -189,38 +162,12 @@ class BlipTVStorage():
         if "action" in params:
             del params["action"]
 
-    def refineStoredSearch(self, params={}):
-        self.common.log("")
-        get = params.get
-        params["store"] = "searches_author"
-        key = self.getStorageKey(params)
-        query = urllib.unquote_plus(get("search"))
-
-        try:
-            searches = eval(self.retrieveValue(key))
-        except:
-            searches = {}
-
-        if query in searches:
-            author = self.common.getUserInput(self.language(30517), 
searches[query])
-        else:
-            author = self.common.getUserInput(self.language(30517), '')
-
-        if author:
-            searches[query] = author
-
-            self.storeValue(key, repr(searches))
-            self.utils.showMessage(self.language(30006), self.language(30616))
-            self.xbmc.executebuiltin("Container.Refresh")
-
     #=================================== Storage Key 
========================================
     def getStorageKey(self, params={}, storage_type="", item={}):
         self.common.log("")
 
         if storage_type == "value":
             return self._getValueStorageKey(params, item)
-        elif storage_type == "viewmode":
-            return self._getViewModeStorageKey(params, item)
         elif storage_type == "thumbnail":
             return self._getThumbnailStorageKey(params, item)
 
@@ -260,24 +207,6 @@ class BlipTVStorage():
 
         return key
 
-    def _getViewModeStorageKey(self, params={}, item={}):
-        self.common.log("")
-        get = params.get
-        iget = item.get
-        key = ""
-
-        if (get("external")):
-            key = "external_" + get("contact") + "_"
-        elif (iget("external")):
-            key = "external_" + iget("contact") + "_"
-
-        if get("channel"):
-            key += "view_mode_" + get("channel")
-        elif (iget("channel")):
-            key += "view_mode_" + iget("channel")
-
-        return key
-
     def _getResultSetStorageKey(self, params={}):
         self.common.log("")
         get = params.get
@@ -315,25 +244,20 @@ class BlipTVStorage():
             self.settings.setSetting(key, value)
 
     def storeResultSet(self, key, results=[], params={}):
-        self.common.log("")
+        self.common.log("" + repr(params))
         get = params.get
 
         if results:
             if get("prepend"):
-                self.common.log("prepend")
                 searchCount = (10, 20, 30, 
40)[int(self.settings.getSetting("saved_searches"))]
                 existing = self.retrieveResultSet(key)
                 existing = results + existing[:searchCount]
                 self.settings.setSetting(key, repr(existing))
             elif get("append"):
-                self.common.log("append")
                 existing = self.retrieveResultSet(key)
-                self.common.log(repr(existing) + " - " + repr(results))
                 existing = existing + results
-                self.common.log(repr(existing))
                 self.settings.setSetting(key, repr(existing))
             else:
-                self.common.log("set")
                 value = repr(results)
                 self.settings.setSetting(key, value)
 
diff --git a/plugin.video.bliptv/addon.xml b/plugin.video.bliptv/addon.xml
index f79357d..d668f79 100644
--- a/plugin.video.bliptv/addon.xml
+++ b/plugin.video.bliptv/addon.xml
@@ -1,10 +1,10 @@
 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<addon id="plugin.video.bliptv" version="0.3.0" name="BlipTV" 
provider-name="TheCollective">
+<addon id='plugin.video.bliptv' version='0.4.0' name='BlipTV' 
provider-name='TheCollective'>
   <requires>
     <import addon='xbmc.python' version='2.0'/>
-    <import addon='script.common.plugin.cache' version='0.9.1'/>
-    <import addon='script.module.parsedom' version='0.9.1'/>
-    <import addon='script.module.simple.downloader' version='0.9.1'/>
+    <import addon='script.common.plugin.cache' version='0.9.2'/>
+    <import addon='script.module.parsedom' version='0.9.2'/>
+    <import addon='script.module.simple.downloader' version='0.9.2'/>
   </requires>
   <extension point='xbmc.python.pluginsource'
             library='default.py'>
@@ -12,9 +12,9 @@
   </extension>
   <extension point='xbmc.addon.metadata'>
     <platform>all</platform>
-    <summary lang="en">Bliptv video plugin</summary>
-    <description lang="en">Plugin that let's you browse and play videos from 
BlipTV!</description>
-    <summary lang="bg">Видео добавка за Bliptv</summary>
-    <description lang="bg">Добавката ви позволява да 
разглеждате и гледате видео клипове от 
BlipTV!</description>
+    <summary lang='en'>Bliptv video plugin</summary>
+    <description lang='en'>Plugin that let's you browse and play videos from 
BlipTV!</description>
+    <summary lang='bg'>Видео добавка за Bliptv</summary>
+    <description lang='bg'>Добавката ви позволява да 
разглеждате и гледате видео клипове от 
BlipTV!</description>
   </extension>
 </addon>
diff --git a/plugin.video.bliptv/changelog.txt 
b/plugin.video.bliptv/changelog.txt
index acd03a2..5a96652 100644
--- a/plugin.video.bliptv/changelog.txt
+++ b/plugin.video.bliptv/changelog.txt
@@ -5,6 +5,11 @@
 
 [B]Errata[/B]
 
+[B]Version 0.4.0[/B]
+- Blip.tv changed their html and broke the show scraper.
+- Listing of locally stored folder lists was broken
+- Cleanup of unused code from template
+
 [B]Version 0.3.0[/B]
 - Updated dependencies on common cache and simple downloader
 - Fixed scraper for searching episodes
diff --git a/plugin.video.bliptv/default.py b/plugin.video.bliptv/default.py
index db87449..aedea66 100644
--- a/plugin.video.bliptv/default.py
+++ b/plugin.video.bliptv/default.py
@@ -26,7 +26,7 @@ try: import xbmcvfs
 except: import xbmcvfsdummy as xbmcvfs
 
 # plugin constants
-version = "0.3.0"
+version = "0.4.0"
 plugin = "BlipTV-" + version
 author = "TheCollective"
 url = "www.xbmc.com"

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

Summary of changes:
 plugin.video.bliptv/BlipTVNavigation.py |   71 ++++++++++----------
 plugin.video.bliptv/BlipTVScraper.py    |   15 ++--
 plugin.video.bliptv/BlipTVStorage.py    |  114 +++++-------------------------
 plugin.video.bliptv/addon.xml           |   16 ++--
 plugin.video.bliptv/changelog.txt       |    5 ++
 plugin.video.bliptv/default.py          |    2 +-
 6 files changed, 76 insertions(+), 147 deletions(-)


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