The branch, eden has been updated
       via  f82af6ed0e60d7200aa041a8afef52c8ea577271 (commit)
       via  f6498148baa73f5a0c94623618ec46a676b15a00 (commit)
      from  ba82c2a3c4109f7a068a4255d8ab6dddfae21496 (commit)

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

commit f82af6ed0e60d7200aa041a8afef52c8ea577271
Author: Martijn Kaijser <[email protected]>
Date:   Mon Jul 16 00:22:42 2012 +0200

    [script.playalbum] -v0.0.6

diff --git a/script.playalbum/README.txt b/script.playalbum/README.txt
index 70332a1..dcf6c6e 100644
--- a/script.playalbum/README.txt
+++ b/script.playalbum/README.txt
@@ -1,3 +1,3 @@
 
-RunScript(script.playalbum,artist=$INFO[ListItem.Artist]&amp;album=$INFO[ListItem.Album])
+RunScript(script.playalbum,artist=$ESCINFO[ListItem.Artist]&amp;album=$ESCINFO[ListItem.Album])
 
diff --git a/script.playalbum/addon.xml b/script.playalbum/addon.xml
index 13ac49f..320858f 100644
--- a/script.playalbum/addon.xml
+++ b/script.playalbum/addon.xml
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.playalbum" name="Play Album Script" version="0.0.5" 
provider-name="ronie">
+<addon id="script.playalbum" name="Play Album Script" version="0.0.6" 
provider-name="ronie">
        <requires>
                <import addon="xbmc.python" version="2.0"/>
                <import addon="script.module.simplejson" version="2.0.10"/>
        </requires>
        <extension point="xbmc.python.library" library="default.py" />
        <extension point="xbmc.addon.metadata">
+               <language/>
                <summary lang="en">Play Album Script</summary>
                <description lang="en">Script will play a full album when 
executed in the album info dialog.</description>
                <platform>all</platform>
diff --git a/script.playalbum/changelog.txt b/script.playalbum/changelog.txt
index f3c4f4c..0050650 100644
--- a/script.playalbum/changelog.txt
+++ b/script.playalbum/changelog.txt
@@ -1,3 +1,6 @@
+v0.0.6:
+- adjust code to work with $ESCINFO
+
 v0.0.5:
 - use title instead of label
 
diff --git a/script.playalbum/default.py b/script.playalbum/default.py
index 1ba8ddf..908b446 100644
--- a/script.playalbum/default.py
+++ b/script.playalbum/default.py
@@ -18,7 +18,7 @@ class Main:
         log('version %s started' % __addonversion__ )
         self._parse_argv()
         self._init_vars()
-        if self.artist != '' and self.album != '':
+        if self.artist and self.album:
             log('artist: %s' % self.artist)
             log('album: %s' % self.album)
             self._get_albumid()
@@ -32,6 +32,11 @@ class Main:
             params = {}
         self.artist = params.get( 'artist', '' )
         self.album = params.get( 'album', '' )
+        if self.artist and self.album:
+            if self.artist.startswith('"') and self.artist.endswith('"'):
+                self.artist = self.artist[1:-1]
+            if self.album.startswith('"') and self.album.endswith('"'):
+                self.album = self.album[1:-1]
 
     def _init_vars( self ):
         self.albumid = ''

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

commit f6498148baa73f5a0c94623618ec46a676b15a00
Author: Martijn Kaijser <[email protected]>
Date:   Mon Jul 16 00:19:34 2012 +0200

    [script.randomitems] -v3.1.1

diff --git a/script.randomitems/README.txt b/script.randomitems/README.txt
index 8d47f8b..5e71d5d 100644
--- a/script.randomitems/README.txt
+++ b/script.randomitems/README.txt
@@ -10,7 +10,7 @@ For example:
  
 XBMC.RunScript(script.randomitems,limit=10&amp;unplayed=True&amp;alarm=30)
 
-will return 10 random, unplayed movies, episodes, albums, songs and addons 
every 30 minutes.
+will return 10 random, unplayed movies, episodes, albums, songs, artists and 
addons every 30 minutes.
 
 
 Labels:
@@ -55,6 +55,7 @@ Labels:
 "RandomAlbum.%d.Fanart"
 "RandomAlbum.%d.Thumb"
 "RandomAlbum.%d.Rating"
+"RandomAlbum.%d.Album_Description"
 "RandomAlbum.Count"
 
 "RandomSong.%d.Title"
@@ -77,6 +78,14 @@ Labels:
 "RandomAddon.%d.Thumb"
 "RandomAddon.Count"
 
+"RandomArtist.%d.Title"
+"RandomArtist.%d.Artist_Description"
+"RandomArtist.%d.Path"
+"RandomArtist.%d.Fanart"
+"RandomArtist.%d.Thumb"
+"RandomArtist.%d.Genre"
+"RandomArtist.Count"
+
 
 For more inforamtion and help please check:
 
diff --git a/script.randomitems/RandomItems.py 
b/script.randomitems/RandomItems.py
index ec73b75..4800718 100644
--- a/script.randomitems/RandomItems.py
+++ b/script.randomitems/RandomItems.py
@@ -2,7 +2,7 @@
 # *
 # *  Nuka for the original RecentlyAdded.py on which this is based
 # *
-# *  ppic, Hitcher & ronie for the updates
+# *  ppic, Hitcher,ronie & phil65 for the updates
 
 import xbmc, xbmcgui, xbmcaddon
 import re, sys, os, random
@@ -78,6 +78,7 @@ class Main:
             self._fetch_episode_info()
             self._fetch_musicvideo_info()
             self._fetch_album_info()
+            self._fetch_artist_info()
             self._fetch_song_info()
             self._fetch_addon_info()
 
@@ -156,7 +157,7 @@ class Main:
                     playcount = item['playcount']
                     if playcount > 0:
                         count = count - 1
-                        continue 
+                        continue
                 title = item['title']
                 showtitle = item['showtitle']
                 season = "%.2d" % float(item['season'])
@@ -206,7 +207,7 @@ class Main:
                     playcount = item['playcount']
                     if playcount > 0:
                         count = count - 1
-                        continue 
+                        continue
                 title = item['title']
                 year = str(item['year'])
                 plot = item['plot']
@@ -228,7 +229,7 @@ class Main:
 
     def _fetch_album_info( self ):
         # query the database
-        json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": 
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "artist", "year", 
"thumbnail", "fanart", "rating"] }, "id": 1}')
+        json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": 
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "description", 
"artist", "year", "thumbnail", "fanart", "rating"] }, "id": 1}')
         json_query = unicode(json_query, 'utf-8', errors='ignore')
         # separate the records
         json_response = simplejson.loads(json_query)
@@ -249,6 +250,7 @@ class Main:
                 json_response.remove( item )
                 # find values
                 title = item['title']
+                description = item['description']
                 rating = str(item['rating'])
                 if rating == '48':
                     rating = ""
@@ -265,8 +267,44 @@ class Main:
                 self.WINDOW.setProperty( "RandomAlbum.%d.Path"   % ( count ), 
path )
                 self.WINDOW.setProperty( "RandomAlbum.%d.Fanart" % ( count ), 
fanart )
                 self.WINDOW.setProperty( "RandomAlbum.%d.Thumb"  % ( count ), 
thumb )
+                self.WINDOW.setProperty( "RandomAlbum.%d.Album_Description"  % 
( count ), description )
                 self.WINDOW.setProperty( "RandomAlbum.Count"     , total )
 
+    def _fetch_artist_info( self ):
+        json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": 
"AudioLibrary.GetArtists", "params": {"properties": ["genre", "description", 
"fanart", "thumbnail"], "sort": { "method": "label" } }, "id": 1}')
+        json_query = unicode(json_query, 'utf-8', errors='ignore')
+        json_response = simplejson.loads(json_query)
+        if (json_response['result'] != None) and 
(json_response['result'].has_key('artists')):
+            json_response = json_response['result']['artists']
+            # get total value
+            total = str( len( json_response ) )
+            # enumerate thru our records
+            count = 0
+            while count < self.LIMIT:
+                count += 1
+                # check if we don't run out of items before LIMIT is reached
+                if len( json_response ) == 0:
+                    return
+                # select a random item
+                item = random.choice( json_response )
+                # remove the item from our list
+                json_response.remove( item )
+                # find values
+                description = item['description']
+                genre = str(item['genre'])
+                artist = item['label']
+                path = 'musicdb://2/' + str(item['artistid']) + '/'
+                fanart = item['fanart']
+                thumb = item['thumbnail']
+                # set our properties
+                self.WINDOW.setProperty( "RandomArtist.%d.Title"  % ( count ), 
artist )
+                self.WINDOW.setProperty( "RandomArtist.%d.Genre" % ( count ), 
genre )
+                self.WINDOW.setProperty( "RandomArtist.%d.Path"   % ( count ), 
path )
+                self.WINDOW.setProperty( "RandomArtist.%d.Fanart" % ( count ), 
fanart )
+                self.WINDOW.setProperty( "RandomArtist.%d.Thumb"  % ( count ), 
thumb )
+                self.WINDOW.setProperty( "RandomArtist.%d.Artist_Description"  
% ( count ), description )
+                self.WINDOW.setProperty( "RandomArtist.Count"     , total )
+
     def _fetch_song_info( self ):
         # query the database
         json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": 
"AudioLibrary.GetSongs", "params": {"properties": ["title", "playcount", 
"artist", "album", "year", "file", "thumbnail", "fanart", "rating"] }, "id": 
1}')
@@ -293,7 +331,7 @@ class Main:
                     playcount = item['playcount']
                     if playcount > 0:
                         count = count - 1
-                        continue 
+                        continue
                 title = item['title']
                 rating = str(int(item['rating'])-48)
                 year = str(item['year'])
diff --git a/script.randomitems/addon.xml b/script.randomitems/addon.xml
index c002082..8b28e69 100644
--- a/script.randomitems/addon.xml
+++ b/script.randomitems/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

-<addon id="script.randomitems" name="Random Items script" version="3.0.9" 
provider-name="Hitcher, ronie">

+<addon id="script.randomitems" name="Random Items script" version="3.1.1" 
provider-name="Hitcher, ronie, phil65">

        <requires>

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

                <import addon="script.module.elementtree" version="1.2.7"/>

@@ -7,6 +7,7 @@
        </requires>

        <extension point="xbmc.python.library" library="RandomItems.py" />

        <extension point="xbmc.addon.metadata">

+               <language/>

                <summary lang="en">Random Items script</summary>

                <description lang="en">Script to get Random Videos and Music 
from the database.</description>

                <platform>all</platform>

diff --git a/script.randomitems/changelog.txt b/script.randomitems/changelog.txt
index ab958cd..35b74f8 100644
--- a/script.randomitems/changelog.txt
+++ b/script.randomitems/changelog.txt
@@ -1,3 +1,18 @@
+v3.1.1
+- added "RandomArtist.%d.Genre"
+
+v3.1.0
+- added "Random Artists" properties:
+
+"RandomArtist.%d.Title"
+"RandomArtist.%d.Path"
+"RandomArtist.%d.Fanart"
+"RandomArtist.%d.Thumb"
+"RandomArtist.%d.Artist_Description"
+
+v3.0.10
+- added album description property (randomalbum.x.album_description)
+
 v3.0.9
 - use title instead of label
 

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

Summary of changes:
 script.playalbum/README.txt       |    2 +-
 script.playalbum/addon.xml        |    3 +-
 script.playalbum/changelog.txt    |    3 ++
 script.playalbum/default.py       |    7 ++++-
 script.randomitems/README.txt     |   11 +++++++-
 script.randomitems/RandomItems.py |   48 +++++++++++++++++++++++++++++++++----
 script.randomitems/addon.xml      |    3 +-
 script.randomitems/changelog.txt  |   15 +++++++++++
 8 files changed, 82 insertions(+), 10 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