Skip to content

Commit

Permalink
new options
Browse files Browse the repository at this point in the history
option to download thumbnails from htbackdrops and fanart.tv
option to use fanart.tv client API key
  • Loading branch information
pkscout committed Aug 24, 2014
1 parent 64ad7de commit f7c5dba
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.artistslideshow" name="Artist Slideshow" version="1.6.9~beta1" provider-name="ronie|pkscout">
<addon id="script.artistslideshow" name="Artist Slideshow" version="1.6.9~beta2" provider-name="ronie|pkscout">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
<import addon="xbmc.addon" version="12.0.0"/>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
@@ -1,3 +1,7 @@
v.1.6.9~beta2
- added option to download artist thumbnails from htbackdrops and fanart.tv
- added option to use fanart.tv client API key

v.1.6.9~beta1
- update to current requests module (requests2 depreciated)
- updated to v3 of fanart.tv API
Expand Down
26 changes: 21 additions & 5 deletions default.py
Expand Up @@ -398,11 +398,18 @@ def _get_data( self, site, item ):
if success:
if site == 'fanarttv':
try:
json_data = json_data['artistbackground']
images = json_data['artistbackground']
except Exception, e:
lw.log( ['error fixing fanart.tv JSON data', e] )
return data
success, loglines = writeFile( dicttoxml( json_data ).encode('utf-8'), filename )
lw.log( ['error getting artist backgrounds from fanart.tv', e] )
images = []
if self.FANARTTVALLIMAGES == 'true':
try:
thumbs = json_data['artistthumb']
except Exception, e:
lw.log( ['error getting artist thumbs from fanart.tv', e] )
thumbs = []
images = images + thumbs
success, loglines = writeFile( dicttoxml( images ).encode('utf-8'), filename )
lw.log( loglines )
json_data = ''
else:
Expand Down Expand Up @@ -808,8 +815,11 @@ def _get_playing_item( self, item ):

def _get_settings( self ):
self.FANARTTV = __addon__.getSetting( "fanarttv" )
self.FANARTTVALLIMAGES = __addon__.getSetting( "fanarttv_all" )
self.FANARTTVCLIENTAPIKEY = __addon__.getSetting( "fanarttv_clientapikey" )
self.THEAUDIODB = __addon__.getSetting( "theaudiodb" )
self.HTBACKDROPS = __addon__.getSetting( "htbackdrops" )
self.HTBACKDROPSALLIMAGES = __addon__.getSetting( "htbackdrops_all" )
self.ARTISTINFO = __addon__.getSetting( "artistinfo" )
self.LANGUAGE = __addon__.getSetting( "language" )
for language in LANGUAGES:
Expand Down Expand Up @@ -888,11 +898,17 @@ def _init_vars( self ):
self.LastfmPARAMS = {'autocorrect':'1', 'api_key':LastfmApiKey}
self.fanarttvURL = 'https://webservice.fanart.tv/v3/music/'
self.fanarttvPARAMS = {'api_key': fanarttvApiKey}
if self.FANARTTVCLIENTAPIKEY:
self.fanarttvPARAMS.update( {'client_key': self.FANARTTVCLIENTAPIKEY} )
theaudiodbURL = 'http://www.theaudiodb.com/api/v1/json/%s/' % theaudiodbApiKey
self.theaudiodbARTISTURL = theaudiodbURL + 'artist-mb.php'
self.theaudiodbALBUMURL = theaudiodbURL + 'album.php'
self.HtbackdropsQueryURL = 'http://htbackdrops.org/api/%s/searchXML' % HtbackdropsApiKey
self.HtbackdropsPARAMS = {'default_operator':'and', 'fields':'title', 'aid':'1'}
if self.HTBACKDROPSALLIMAGES == 'true':
aid = '1,5'
else:
aid = '1'
self.HtbackdropsPARAMS = {'default_operator':'and', 'fields':'title', 'aid':aid}
self.HtbackdropsDownloadURL = 'http://htbackdrops.org/api/' + HtbackdropsApiKey + '/download/'


Expand Down
10 changes: 7 additions & 3 deletions resources/language/English/strings.po
Expand Up @@ -54,7 +54,7 @@ msgid "Download images from last.fm"
msgstr ""

msgctxt "#32002"
msgid "Download images from htbackdrops.com"
msgid "Download images from htbackdrops.org"
msgstr ""

msgctxt "#32003"
Expand All @@ -74,7 +74,7 @@ msgid " Preferred language for artist information"
msgstr ""

msgctxt "#32007"
msgid " Download only 16:9 images"
msgid " Download all images regardless of resolution"
msgstr ""

msgctxt "#32008"
Expand All @@ -85,7 +85,11 @@ msgctxt "#32009"
msgid "Download images from theaudiodb.com"
msgstr ""

#empty strings from id 32010 to 32099
msgctxt "#32010"
msgid " Client API key"
msgstr ""

#empty strings from id 32011 to 32099

msgctxt "#32100"
msgid "Slideshow"
Expand Down
11 changes: 7 additions & 4 deletions resources/settings.xml
Expand Up @@ -2,23 +2,26 @@
<settings>
<category label="32000">
<setting id="fanarttv" type="bool" label="32008" default="true" />
<setting id="fanarttv_clientapikey" type="text" label="32010" visible="eq(-1,true)" default="" />
<setting id="fanarttv_all" type="bool" label="32007" visible="eq(-2,true)" default="false" />
<setting id="theaudiodb" type="bool" label="32009" default="false" />
<setting id="htbackdrops" type="bool" label="32002" default="false" />
<setting id="htbackdrops_all" type="bool" label="32007" visible="eq(-1,true)" 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="32901|32902|32903|32904|32905|32906|32907|32908|32909|32910|32911|32912|32913|32947|32914|32915|32916|32917|32918|32919|32920|32921|32922|32924|32925|32926|32927|32928|32929|32930|32932|32933|32934|32935|32936|32937|32938|32939|32940|32942|32943|32944|32945|32946" />
<setting id="language" type="enum" label="32006" visible="eq(-1,true)" default="11" lvalues="32901|32902|32903|32904|32905|32906|32907|32908|32909|32910|32911|32912|32913|32947|32914|32915|32916|32917|32918|32919|32920|32921|32922|32924|32925|32926|32927|32928|32929|32930|32932|32933|32934|32935|32936|32937|32938|32939|32940|32942|32943|32944|32945|32946" />
</category>
<category label="32100">
<setting id="local_artist_path" type="folder" label="32101" default="" />
<setting id="priority" type="enum" label="32102" lvalues="32110|32111|32112" default="0" />
<setting id="fallback" type="bool" label="32105" default="false" />
<setting id="fallback_path" type="folder" label="32103" default="" enable="eq(-1,true)" />
<setting id="fallback_path" type="folder" label="32103" default="" visible="eq(-1,true)" />
<setting id="slideshow" type="bool" label="32106" default="false" />
<setting id="slideshow_path" type="folder" label="32104" default="" enable="eq(-1,true)" />
<setting id="slideshow_path" type="folder" label="32104" default="" visible="eq(-1,true)" />
<setting id="transparent" type="bool" label="32107" default="false" />
</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="max_cache_size" label="32202" type="labelenum" values="128|256|512|768|1024|2048|3072|4096" visible="eq(-1,true)" default="1024" />
<setting id="show_progress" type="enum" label="32203" lvalues="32206|32207|32208" default="0" />
<setting id="progress_path" type="folder" label="32204" default="" enable="eq(-1,2)"/>
<setting id="fanart_folder" type="text" label="32205" default="" />
Expand Down

0 comments on commit f7c5dba

Please sign in to comment.