The branch, eden has been updated
       via  4a30948f0b18d619efa41e4266eac5139014d1ba (commit)
      from  29e34551016275f37db29b9056efbf382a90df4b (commit)

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

commit 4a30948f0b18d619efa41e4266eac5139014d1ba
Author: Martijn Kaijser <[email protected]>
Date:   Fri Jul 20 23:24:42 2012 +0200

    [script.artistslideshow] -v1.4.0

diff --git a/script.artistslideshow/addon.xml b/script.artistslideshow/addon.xml
index 1a04968..8de8b8f 100644
--- a/script.artistslideshow/addon.xml
+++ b/script.artistslideshow/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.artistslideshow" name="Artist Slideshow" version="1.3.2" 
provider-name="ronie/kyleejohnson (pkscuot)">
+<addon id="script.artistslideshow" name="Artist Slideshow" version="1.4.0" 
provider-name="ronie/kyleejohnson (pkscuot)">
        <requires>
                <import addon="xbmc.python" version="2.0"/>
                <import addon="script.module.elementtree" version="1.2.7"/>
diff --git a/script.artistslideshow/changelog.txt 
b/script.artistslideshow/changelog.txt
index 644662a..9042cc4 100644
--- a/script.artistslideshow/changelog.txt
+++ b/script.artistslideshow/changelog.txt
@@ -1,3 +1,9 @@
+v.1.4.0
+- added ability to display artwork from multiple artists simultaneously
+- added option for a folder name other than extrafanart
+- added notification when downloading first image for an artist
+- added option for user to set image to use during download of first artist 
image
+
 v1.3.2
 - added language files for Portuguese-Brazil (thanks to Wanilton)
 
diff --git a/script.artistslideshow/default.py 
b/script.artistslideshow/default.py
index b24aa82..b5d943b 100644
--- a/script.artistslideshow/default.py
+++ b/script.artistslideshow/default.py
@@ -17,6 +17,8 @@ __addon__        = xbmcaddon.Addon()
 __addonname__    = __addon__.getAddonInfo('id')
 __addonversion__ = __addon__.getAddonInfo('version')
 __addonpath__    = __addon__.getAddonInfo('path')
+__addonicon__    = xbmc.translatePath('%s/icon.png' % __addonpath__ )
+__language__     = __addon__.getLocalizedString
 
 socket.setdefaulttimeout(10)
 
@@ -133,7 +135,8 @@ class Main:
                 time.sleep(0.5)
                 if xbmc.getInfoLabel( self.ARTISTSLIDESHOWRUNNING ) == "True":
                     if( xbmc.Player().isPlayingAudio() == True or 
xbmc.getInfoLabel( self.EXTERNALCALL ) != '' ):
-                        if self.NAME != self._get_current_artist():
+                        #if self.NAME not in self._get_current_artist():
+                        if set( self.ALLARTISTS ) <> set( 
self._get_current_artist() ):
                             self._clear_properties()
                             self.UsingFallback = False
                             self._use_correct_artwork()
@@ -146,6 +149,7 @@ class Main:
                         time.sleep(1) # doublecheck if playback really stopped
                         if( xbmc.Player().isPlayingAudio() == False and 
xbmc.getInfoLabel( self.EXTERNALCALL ) == '' ):
                             if ( self.DAEMON == "False" ):
+                                self._clean_dir( self.MergeDir )
                                 
self.WINDOW.clearProperty("ArtistSlideshowRunning")
                 else:
                     self._clear_properties()
@@ -153,25 +157,34 @@ class Main:
 
 
     def _use_correct_artwork( self ):
-        if(self.PRIORITY == '1' and not self.LOCALARTISTPATH == ''):
-            log('looking for local artwork')
-            self._get_local_images()
-            if(not self.LocalImagesFound):
-                log('no local artist artwork found, start download')
-                self._start_download()
-        elif(self.PRIORITY == '2' and not self.LOCALARTISTPATH == ''):
-            log('looking for local artwork')
-            self._get_local_images()
-            log('start download')
-            self._start_download()
-        else:
-            log('start download')
-            self._start_download()
-            if(not (self.CachedImagesFound or self.ImageDownloaded)):
-                log('no remote artist artwork found, looking for local 
artwork')
+        self._clean_dir( self.MergeDir )
+       artists = self._get_current_artist()
+       self.ALLARTISTS = artists
+       self.ARTISTNUM = 0
+       self.TOTALARTISTS = len(artists)
+       self.MergedImagesFound = False
+       for artist in artists:
+           log('current artist is %s' % artist)
+           self.ARTISTNUM += 1
+            self.NAME = artist
+            if(self.PRIORITY == '1' and not self.LOCALARTISTPATH == ''):
+                log('looking for local artwork')
                 self._get_local_images()
-        
-        if(not (self.LocalImagesFound or self.CachedImagesFound or 
self.ImageDownloaded)):
+                if(not self.LocalImagesFound):
+                    log('no local artist artwork found, start download')
+                    self._start_download()
+            elif(self.PRIORITY == '2' and not self.LOCALARTISTPATH == ''):
+                log('looking for local artwork')
+                self._get_local_images()
+                log('start download')
+                self._start_download()
+            else:
+                log('start download')
+                self._start_download()
+                if(not (self.CachedImagesFound or self.ImageDownloaded)):
+                    log('no remote artist artwork found, looking for local 
artwork')
+                    self._get_local_images()
+        if(not (self.LocalImagesFound or self.CachedImagesFound or 
self.ImageDownloaded or self.MergedImagesFound)):
             if (not self.FALLBACKPATH == ''):
                 log('no images found for artist, using fallback slideshow')
                 log('fallbackdir = ' + self.FALLBACKPATH)
@@ -221,6 +234,16 @@ class Main:
             self.maxcachesize = int(__addon__.getSetting( "max_cache_size" )) 
* 1000000
         except:
             self.maxcachesize = 1024 * 1000000
+        if ( len ( __addon__.getSetting( "progress_path" ) ) > 0 ) and ( 
__addon__.getSetting( "show_progress" ) == "true" ):
+            self.PROGRESSPATH = __addon__.getSetting( "progress_path" )
+            log('set progress path to %s' % self.PROGRESSPATH)
+        else:
+               self.PROGRESSPATH = ''
+        if len ( __addon__.getSetting( "fanart_folder" ) ) > 0:
+            self.FANARTFOLDER = __addon__.getSetting( "fanart_folder" )
+            log('set fanart folder to %s' % self.FANARTFOLDER)
+        else:
+               self.FANARTFOLDER = 'extrafanart'
 
 
     def _init_vars( self ):
@@ -236,12 +259,15 @@ class Main:
         self.EXTERNALCALLSTATUS = xbmc.getInfoLabel( self.EXTERNALCALL )
         log( 'external call is set to ' + xbmc.getInfoLabel( self.EXTERNALCALL 
) )
         self.NAME = ''
+        self.ALLARTISTS = []
         self.LocalImagesFound = False
         self.CachedImagesFound = False
         self.ImageDownloaded = False
         self.DownloadedAllImages = False
         self.UsingFallback = False
         self.BlankDir = 
xbmc.translatePath('special://profile/addon_data/%s/transition' % __addonname__ 
)
+        self.MergeDir = 
xbmc.translatePath('special://profile/addon_data/%s/merge' % __addonname__ )    
+        self.InitDir = xbmc.translatePath('%s/resources/black' % __addonpath__ 
)
         LastfmApiKey = 'fbd57a1baddb983d1848a939665310f6'
         HtbackdropsApiKey = '96d681ea0dcb07ad9d27a347e64b652a'
         self.LastfmURL = 
'http://ws.audioscrobbler.com/2.0/?autocorrect=1&api_key=' + LastfmApiKey
@@ -263,7 +289,6 @@ class Main:
         self.ImageDownloaded = False
         self.FirstImage = True
         min_refresh = 9.9
-        self.NAME = self._get_current_artist()
         if len(self.NAME) == 0:
             log('no artist name provided')
             return
@@ -283,12 +308,19 @@ class Main:
 
         if self.CachedImagesFound:
             log('cached images found')
-            self.WINDOW.setProperty("ArtistSlideshow", self.CacheDir)
             last_time = time.time()
-            if self.ARTISTINFO == "true":
-                self._get_artistinfo()
+            if self.ARTISTNUM == 1:
+                self.WINDOW.setProperty("ArtistSlideshow", self.CacheDir)
+                if self.ARTISTINFO == "true":
+                    self._get_artistinfo()
         else:
             last_time = 0
+            if self.ARTISTNUM == 1:
+                if len ( self.PROGRESSPATH ) > 0:
+                    self.WINDOW.setProperty("ArtistSlideshow", 
self.PROGRESSPATH)
+                else:
+                    self.WINDOW.setProperty("ArtistSlideshow", self.InitDir)
+                    xbmc.executebuiltin('XBMC.Notification("' + 
__language__(30300) + '", "' + __language__(30301) + '", 10000, ' + 
__addonicon__ + ')')
 
         if self.LASTFM == "true":
             lastfmlist = self._get_images('lastfm')
@@ -318,19 +350,19 @@ class Main:
                     log('downloaded %s to %s' % (url, path) )
                     self.ImageDownloaded=True
             if self.ImageDownloaded:
-                if( self._playback_stopped_or_changed() ):
+                if( self._playback_stopped_or_changed() and self.ARTISTNUM == 
1 ):
                     self.WINDOW.setProperty("ArtistSlideshow", self.CacheDir)
                     self._clean_dir( self.BlankDir )
                     return
                 if not self.CachedImagesFound:
                     self.CachedImagesFound = True
-                    if self.ARTISTINFO == "true":
+                    if self.ARTISTINFO == "true" and self.ARTISTNUM == 1:
                         self._get_artistinfo()
                 wait_elapsed = time.time() - last_time
                 if( wait_elapsed > min_refresh ):
                     if( not (self.FirstImage and not self.CachedImagesFound) ):
                         self._wait( min_refresh - (wait_elapsed % min_refresh) 
)
-                    if( not self._playback_stopped_or_changed() ):
+                    if( not self._playback_stopped_or_changed() and 
self.ARTISTNUM == 1 ):
                         self._refresh_image_directory()
                     last_time = time.time()
                 self.FirstImage = False
@@ -347,8 +379,11 @@ class Main:
             if( wait_elapsed < min_refresh ):
                 self._wait( min_refresh - wait_elapsed )
             if( not self._playback_stopped_or_changed() ):
-                self._refresh_image_directory()
-            if( xbmc.getInfoLabel( self.ARTISTSLIDESHOW ) == self.BlankDir ):
+                if self.ARTISTNUM == 1:
+                    self._refresh_image_directory()
+                if self.TOTALARTISTS > 1:
+                    self._merge_images()                
+            if( xbmc.getInfoLabel( self.ARTISTSLIDESHOW ) == self.BlankDir and 
self.ARTISTNUM == 1):
                 self._wait( min_refresh )
                 if( not self._playback_stopped_or_changed() ):
                     self._refresh_image_directory()
@@ -358,10 +393,13 @@ class Main:
             log('no images downloaded')
             self.DownloadedAllImages = True
             if not self.CachedImagesFound:
-                log('clearing ArtistSlideshow property')
-                self.WINDOW.clearProperty("ArtistSlideshow")
-                if( self.ARTISTINFO == "true" and not 
self._playback_stopped_or_changed() ):
-                    self._get_artistinfo()
+                if self.ARTISTNUM == 1:
+                    log('clearing ArtistSlideshow property')
+                    self.WINDOW.clearProperty("ArtistSlideshow")
+                    if( self.ARTISTINFO == "true" and not 
self._playback_stopped_or_changed() ):
+                        self._get_artistinfo()
+            elif self.TOTALARTISTS > 1:
+                self._merge_images()
 
 
     def _wait( self, wait_time ):
@@ -395,21 +433,26 @@ class Main:
 
 
     def _get_current_artist( self ):
+        check_title = False
         if( xbmc.Player().isPlayingAudio() == True ):
             artist = xbmc.Player().getMusicInfoTag().getArtist()
+            featured_artist = 
xbmc.Player().getMusicInfoTag().getTitle().replace('ft.','feat.').split('feat.')
             if( artist == '' ):
-                artist = xbmc.Player().getMusicInfoTag().getTitle()
-                return artist[0:(artist.find('-'))-1]
+                artist = 
xbmc.Player().getMusicInfoTag().getTitle()[0:(artist.find('-'))-1]
             else:
-                return artist
+                check_title = True
         elif( not xbmc.getInfoLabel( self.SKINARTIST ) == '' ):
-            return  xbmc.getInfoLabel( self.SKINARTIST )
+            artist = xbmc.getInfoLabel( self.SKINARTIST )
         else:
-            return ''
+            artist = ''
+        artists = artist.replace('ft.','/').replace('feat.','/').split('/')
+        if check_title and len( featured_artist ) > 1:
+            artists.append( featured_artist[-1] )
+        return [a.strip(' ()') for a in artists]
 
 
     def _playback_stopped_or_changed( self ):
-        if (self.NAME != self._get_current_artist() or self.EXTERNALCALLSTATUS 
!= xbmc.getInfoLabel(self.EXTERNALCALL) ):
+        if ( set(self.ALLARTISTS) <> set(self._get_current_artist()) or 
self.EXTERNALCALLSTATUS != xbmc.getInfoLabel(self.EXTERNALCALL) ):
             return True
         else:
             return False
@@ -417,11 +460,10 @@ class Main:
 
     def _get_local_images( self ):
         self.LocalImagesFound = False
-        self.NAME = self._get_current_artist()
         if len(self.NAME) == 0:
             log('no artist name provided')
             return
-        self.CacheDir = self.LOCALARTISTPATH + self.NAME + '/extrafanart'
+        self.CacheDir = self.LOCALARTISTPATH + self.NAME + '/' + 
self.FANARTFOLDER
         log('cachedir = %s' % self.CacheDir)
         try:
             files = os.listdir(self.CacheDir)
@@ -430,12 +472,25 @@ class Main:
         for file in files:
             if(file.endswith('tbn') or file.endswith('jpg') or 
file.endswith('jpeg') or file.endswith('gif') or file.endswith('png')):
                 self.LocalImagesFound = True
-
         if self.LocalImagesFound:
             log('local images found')
-            self.WINDOW.setProperty("ArtistSlideshow", self.CacheDir)
-            if self.ARTISTINFO == "true":
-                self._get_artistinfo()
+            if self.ARTISTNUM == 1:
+                self.WINDOW.setProperty("ArtistSlideshow", self.CacheDir)
+                if self.ARTISTINFO == "true":
+                    self._get_artistinfo()
+            if self.TOTALARTISTS > 1:
+               self._merge_images()                
+
+
+    def _merge_images( self ):
+        self.MergedImagesFound = True                
+        files = os.listdir(self.CacheDir)
+        for file in files:
+            if(file.endswith('tbn') or file.endswith('jpg') or 
file.endswith('jpeg') or file.endswith('gif') or file.endswith('png')):
+                xbmcvfs.copy(os.path.join(self.CacheDir, file), 
os.path.join(self.MergeDir, file))
+        if self.ARTISTNUM == self.TOTALARTISTS:
+            self._wait( 9.8 )
+            self.WINDOW.setProperty("ArtistSlideshow", self.MergeDir)
 
 
     def _trim_cache( self ):
diff --git a/script.artistslideshow/resources/language/English/strings.xml 
b/script.artistslideshow/resources/language/English/strings.xml
index 7f74a65..e4499fb 100644
--- a/script.artistslideshow/resources/language/English/strings.xml
+++ b/script.artistslideshow/resources/language/English/strings.xml
@@ -45,6 +45,9 @@
     <string id="30245">Ukrainian</string>
     <string id="30246">Vietnamese</string>
     <string id="30247">Farsi</string>
+  <!-- Dialog Text -->
+    <string id="30300">Please be Patient</string>
+    <string id="30301">Downloading first artist image</string>
   <!-- Settings  --> 
     <string id="32000">Download</string>
     <string id="32001">Download images from last.fm</string>
@@ -65,4 +68,7 @@
     <string id="32200">Advanced</string>
     <string id="32201">Limit size of download cache</string>
     <string id="32202">  Maximum cache size (in megabytes)</string>
+    <string id="32203">Display progress images during first download</string>
+    <string id="32204">  Progress images folder</string>
+    <string id="32205">Alternate name for local fanart folder</string>
 </strings>
diff --git a/script.artistslideshow/resources/language/Portuguese 
(Brazil)/strings.xml b/script.artistslideshow/resources/language/Portuguese 
(Brazil)/strings.xml
index ce7acc8..02896e3 100644
--- a/script.artistslideshow/resources/language/Portuguese (Brazil)/strings.xml 
+++ b/script.artistslideshow/resources/language/Portuguese (Brazil)/strings.xml 
@@ -45,6 +45,9 @@
     <string id="30245">Ukrainian</string>
     <string id="30246">Vietnamese</string>
     <string id="30247">Farsi</string>
+  <!-- Dialog Text -->
+    <string id="30300">Por favor, aguarde</string>
+    <string id="30301">Baixando primeira imagem do artista</string>
   <!-- Settings  --> 
     <string id="32000">Download</string>
     <string id="32001">Download imagens do last.fm</string>
@@ -65,4 +68,7 @@
     <string id="32200">Avançado</string>
     <string id="32201">Tamanho Limite do cache para download</string>
     <string id="32202">  Tamanho do cache máximo (em megabytes)</string>
+    <string id="32203">Exibir imagens de progresso durante a primeira 
transferência</string>
+    <string id="32204">  Pasta de imagens Progresso</string>
+    <string id="32205">Alternate name for local fanart folder</string>
 </strings>
diff --git a/script.artistslideshow/resources/settings.xml 
b/script.artistslideshow/resources/settings.xml
index 2b4b3d5..d48b2bc 100644
--- a/script.artistslideshow/resources/settings.xml
+++ b/script.artistslideshow/resources/settings.xml
@@ -1,22 +1,25 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <settings>
     <category label="32000">
-        <setting id="lastfm" type="bool" label="32001" default="true"/>
-        <setting id="htbackdrops" type="bool" label="32002" default="false"/>
-        <setting id="minwidth" type="text" label="32003" default="0"/>
-        <setting id="minheight" type="text" label="32004" default="0"/>
-        <setting id="hd_aspect_only" type="bool" label="32007" 
default="false"/>
-        <setting id="artistinfo" type="bool" label="32005" default="false"/>
-        <setting id="language" type="enum" label="32006" enable="eq(-1,true)" 
default="11" 
lvalues="30201|30202|30203|30204|30205|30206|30207|30208|30209|30210|30211|30212|30213|30247|30214|30215|30216|30217|30218|30219|30220|30221|30222|30224|30225|30226|30227|30228|30229|30230|30232|30233|30234|30235|30236|30237|30238|30239|30240|30242|30243|30244|30245|30246"/>
+        <setting id="lastfm" type="bool" label="32001" default="true" />
+        <setting id="htbackdrops" type="bool" label="32002" default="false" />
+        <setting id="minwidth" type="text" label="32003" default="0" />
+        <setting id="minheight" type="text" label="32004" default="0" />
+        <setting id="hd_aspect_only" type="bool" label="32007" default="false" 
/>
+        <setting id="artistinfo" type="bool" label="32005" default="false" />
+        <setting id="language" type="enum" label="32006" enable="eq(-1,true)" 
default="11" 
lvalues="30201|30202|30203|30204|30205|30206|30207|30208|30209|30210|30211|30212|30213|30247|30214|30215|30216|30217|30218|30219|30220|30221|30222|30224|30225|30226|30227|30228|30229|30230|30232|30233|30234|30235|30236|30237|30238|30239|30240|30242|30243|30244|30245|30246"
 />
     </category>
     <category label="32100">
-        <setting id="local_artist_path" type="folder" label="32101" 
default=""/>
-        <setting id="priority" type="enum" label="32102" 
lvalues="32901|32902|32903" default="0"/>
-        <setting id="fallback_path" type="folder" label="32103" default=""/>
-        <setting id="slideshow_path" type="folder" label="32104" default=""/>
+        <setting id="local_artist_path" type="folder" label="32101" default="" 
/>
+        <setting id="priority" type="enum" label="32102" 
lvalues="32901|32902|32903" default="0" />
+        <setting id="fallback_path" type="folder" label="32103" default="" />
+        <setting id="slideshow_path" type="folder" label="32104" default="" />
     </category>
     <category label="32200">
         <setting id="restrict_cache" type="bool" label="32201" default="false" 
/>
         <setting id="max_cache_size" label="32202" type="labelenum" 
values="128|256|512|768|1024|2048|3072|4096" enable="eq(-1,true)" 
default="1024" />
+        <setting id="show_progress" type="bool" label="32203" default="false" 
/>
+        <setting id="progress_path" type="folder" label="32204" default="" />
+               <setting id="fanart_folder" type="text" label="32205" 
default="" />
     </category>
 </settings>

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

Summary of changes:
 script.artistslideshow/addon.xml                   |    2 +-
 script.artistslideshow/changelog.txt               |    6 +
 script.artistslideshow/default.py                  |  143 ++++++++++++++------
 .../resources/black/black-hd.jpg                   |  Bin 0 -> 3441 bytes
 .../resources/language/English/strings.xml         |    6 +
 .../language/Portuguese (Brazil)/strings.xml       |    6 +
 script.artistslideshow/resources/settings.xml      |   25 ++--
 7 files changed, 132 insertions(+), 56 deletions(-)
 create mode 100644 script.artistslideshow/resources/black/black-hd.jpg


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