The branch, eden has been updated
       via  9fa9be2af05d9b8a0936914665d0fe3c15a57db7 (commit)
      from  dad48645cbe298346f1a4a86054764066cc6405c (commit)

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

commit 9fa9be2af05d9b8a0936914665d0fe3c15a57db7
Author: amet <[email protected]>
Date:   Sun Jun 24 15:31:54 2012 +0400

    [script.randomandlastitems] -1.2.3
    
    - [Fix] Albums properties were not cleared properly
    - [Add] New property AlbumDesc

diff --git a/script.randomandlastitems/LISEZMOI.txt 
b/script.randomandlastitems/LISEZMOI.txt
index 1ae73d6..4ab01f0 100644
--- a/script.randomandlastitems/LISEZMOI.txt
+++ b/script.randomandlastitems/LISEZMOI.txt
@@ -77,6 +77,7 @@ Playlist<method>Music<menu>.<# of album>.Fanart = Fanart de 
l'album N
 Playlist<method>Music<menu>.<# of album>.Thumb = Vignette de l'album N°#
 Playlist<method>Music<menu>.<# of album>.ArtistPath = Chemin complet de 
l'artiste de l'album N°# (ex : C:\Musique\Artiste1)
 Playlist<method>Music<menu>.<# of album>.AlbumPath = Chemin complet de l'album 
N°# (ex : C:\Musique\Artiste1\Album1)
+Playlist<method>Music<menu>.<# of album>.AlbumDesc = Description de l'album N°#
 Playlist<method>Music<menu>.<# of album>.PlayPath = Chemin de l'album N°# pour 
la lecture (musicdb://3/1/)
 
 Avec :
diff --git a/script.randomandlastitems/README.txt 
b/script.randomandlastitems/README.txt
index 86f65b5..b898d7d 100644
--- a/script.randomandlastitems/README.txt
+++ b/script.randomandlastitems/README.txt
@@ -75,6 +75,7 @@ Playlist<method>Music<menu>.<# of album>.Fanart = Album N
 Playlist<method>Music<menu>.<# of album>.Thumb = Album N°# thumbnail
 Playlist<method>Music<menu>.<# of album>.ArtistPath = Album N°# artist path 
(eg : C:\Music\Artist1)
 Playlist<method>Music<menu>.<# of album>.AlbumPath = Album N°# path (ex : 
C:\Music\Artist1\Album1)
+Playlist<method>Music<menu>.<# of album>.AlbumDesc = Album N°# description
 Playlist<method>Music<menu>.<# of album>.PlayPath = Album N°# for playing 
(musicdb://3/1/)
 
 With :
diff --git a/script.randomandlastitems/addon.xml 
b/script.randomandlastitems/addon.xml
index ea9bc01..fa41cad 100644
--- a/script.randomandlastitems/addon.xml
+++ b/script.randomandlastitems/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

-<addon id="script.randomandlastitems" name="Random and Last items script" 
version="1.2.3" provider-name="MikeBZH44">

+<addon id="script.randomandlastitems" name="Random and Last items script" 
version="1.2.4" provider-name="MikeBZH44">

        <requires>

                <import addon="xbmc.python" version="2.0"/>

                <import addon="script.module.simplejson" version="2.0.10"/>

diff --git a/script.randomandlastitems/changelog.txt 
b/script.randomandlastitems/changelog.txt
index e27c25e..c10f0b8 100644
--- a/script.randomandlastitems/changelog.txt
+++ b/script.randomandlastitems/changelog.txt
@@ -1,3 +1,7 @@
+v1.2.4
+- [Fix] Albums properties were not cleared properly
+- [Add] New property AlbumDesc
+
 v1.2.3
 - [Fix] Episode title is now based on title and not on label because of some 
JSON changes :
 
http://forum.xbmc.org/showthread.php?tid=113702&pid=1047340&highlight=episodetitle#pid1049580
diff --git a/script.randomandlastitems/randomandlastitems.py 
b/script.randomandlastitems/randomandlastitems.py
index 0921d60..369decb 100644
--- a/script.randomandlastitems/randomandlastitems.py
+++ b/script.randomandlastitems/randomandlastitems.py
@@ -358,7 +358,7 @@ def _getAlbumsFromPlaylist ( ):
         for _file in _files:
             if _file['type'] == 'album':
                 _albumid = _file['id']
-                # Playlist de type album donc on recherche les path en 
interrogeant les chansons
+                # Album playlist so get path from songs
                 _json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", 
"method": "AudioLibrary.GetSongs", "params": {"albumid": %s, "properties": 
["file"]}, "id": 1}' %(_albumid))
                 _json_query = unicode(_json_query, 'utf-8', errors='ignore')
                 _json_pl_response = simplejson.loads(_json_query)
@@ -404,11 +404,18 @@ def _getAlbumsFromPlaylist ( ):
             # Remove item from JSON list
             _albums.remove( _album )
             _count += 1
+            # Get album description
+            _json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": 
"AudioLibrary.GetAlbumDetails", "params": {"albumid": %s, "properties": 
["description"]}, "id": 1}' %(_albumid))
+            _json_query = unicode(_json_query, 'utf-8', errors='ignore')
+            _json_pl_response = simplejson.loads(_json_query)
+            _result = _json_pl_response.get( "result", {} ).get( 
"albumdetails" )
+            _albumdesc = _result.get ("description")
+            _album["albumDesc"] = _albumdesc
             _setAlbumProperties ( _album, _count )
         if _count != LIMIT:
             while _count < LIMIT:
                 _count += 1
-                _setEpisodeProperties ( None, _count )
+                _setAlbumProperties ( None, _count )
     else:
         print("[RandomAndLastItems] ## PLAYLIST %s COULD NOT BE LOADED ##" 
%(PLAYLIST))
         print("[RandomAndLastItems] JSON RESULT ", _json_pl_response)
@@ -533,6 +540,7 @@ def _setAlbumProperties ( _album, _count ):
         fanart = _album['fanart']
         artistPath = _album['artistPath']
         albumPath = _album['albumPath']
+        albumDesc = _album['albumDesc']
         playPath = "musicdb://3/%s/" %(_album['id'])
     else:
         album = ""
@@ -542,6 +550,7 @@ def _setAlbumProperties ( _album, _count ):
         fanart = ""
         artistPath = ""
         albumPath = ""
+        albumDesc = ""
         playPath = ""
     # Set window properties
     _setProperty( "%s.%d.Album"      % ( PROPERTIE, _count ), album )
@@ -551,6 +560,7 @@ def _setAlbumProperties ( _album, _count ):
     _setProperty( "%s.%d.Fanart"     % ( PROPERTIE, _count ), fanart)
     _setProperty( "%s.%d.ArtistPath" % ( PROPERTIE, _count ), artistPath)
     _setProperty( "%s.%d.AlbumPath"  % ( PROPERTIE, _count ), albumPath)
+    _setProperty( "%s.%d.AlbumDesc"  % ( PROPERTIE, _count ), albumDesc)
     _setProperty( "%s.%d.PlayPath"   % ( PROPERTIE, _count ), playPath)
 
 def _setProperty ( _property, _value ):

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

Summary of changes:
 script.randomandlastitems/LISEZMOI.txt          |    1 +
 script.randomandlastitems/README.txt            |    1 +
 script.randomandlastitems/addon.xml             |    2 +-
 script.randomandlastitems/changelog.txt         |    4 ++++
 script.randomandlastitems/randomandlastitems.py |   14 ++++++++++++--
 5 files changed, 19 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to