improved addon options

This commit is contained in:
gordielachance 2016-10-04 02:19:56 +02:00
parent ff52a69087
commit 5307f5d8c4
2 changed files with 10 additions and 11 deletions

12
main.py
View File

@ -36,7 +36,7 @@ sys.path.append(xbmc.translatePath(
#_ = plugin.initialize_gettext()
connection = None
cache_minutes = int(Addon().get_setting('cache_minutes'))
cachetime = int(Addon().get_setting('cachetime'))
import libsonic_extra
@ -253,7 +253,7 @@ def menu_tracks(params):
)
@plugin.action()
#@plugin.cached(cache_minutes) #if cache is enabled, cache data for the following function
#@plugin.cached(cachetime) #if cache is enabled, cache data for the following function
def list_artists(params):
# get connection
@ -318,7 +318,7 @@ def list_artists(params):
)
@plugin.action()
#@plugin.cached(cache_minutes) #if cache is enabled, cache data for the following function
#@plugin.cached(cachetime) #if cache is enabled, cache data for the following function
def list_albums(params):
listing = []
@ -391,7 +391,7 @@ def list_albums(params):
)
@plugin.action()
#@plugin.cached(cache_minutes) #if cache is enabled, cache data for the following function
#@plugin.cached(cachetime) #if cache is enabled, cache data for the following function
def list_artist_albums(params):
# get connection
@ -475,7 +475,7 @@ def get_album_entry(item, params):
return entry
@plugin.action()
#@plugin.cached(cache_minutes) #if cache is enabled, cache data for the following function
#@plugin.cached(cachetime) #if cache is enabled, cache data for the following function
def list_tracks(params):
menu_id = params.get('menu_id')
@ -661,7 +661,7 @@ def convert_date_from_iso8601(iso8601):
return date_obj.strftime('%d.%m.%Y')
@plugin.action()
#@plugin.cached(cache_minutes) #if cache is enabled, cache data for the following function
#@plugin.cached(cachetime) #if cache is enabled, cache data for the following function
def list_playlists(params):
# get connection

View File

@ -9,10 +9,11 @@
<setting label="Display" type="lsep" />
<setting id="albums_per_page" type="labelenum" label="Albums per page" default="50" values="10|25|50|100|250|500"/>
<setting id="tracks_per_page" type="labelenum" label="Tracks per page (ignored in albums & playlists)" default="100" values="10|25|50|100|250|500"/>
<setting label="Download" type="lsep" />
<setting id="download_folder" type="folder" label="Download folder" source="auto" option="writeable"/>
<setting label="Streaming" type="lsep" />
<setting id="transcode_format_streaming" type="labelenum" label="Transcode format" values="mp3|raw|flv|ogg"/>
<setting id="bitrate_streaming" type="labelenum" label="Bitrate" values="320|256|224|192|160|128|112|96|80|64|56|48|40|32"/>
<setting id="download_folder" type="folder" label="Download folder" source="auto" option="writeable"/>
</category>
<!-- ADVANCED -->
@ -20,9 +21,7 @@
<setting label="Server" type="lsep" />
<setting id="apiversion" type="labelenum" label="API version" values="1.11.0|1.12.0|1.13.0|1.14.0" default="1.13.0"/>
<setting id="insecure" type="bool" label="Allow self signed certificates" default="false" />
<setting label="Cache" type="lsep" />
<setting id="cache_minutes" type="labelenum" label="Cache datas time (in minutes)" default="30" values="1|15|30|60|120|180|720|1440"/>
<setting label="Debug" type="lsep" />
<setting label="Enable Debug mode" type="bool" id="debug" default="false" />
<setting label="Cache (in minutes) - not yet implemented" type="lsep" />
<setting id="cachetime" type="labelenum" label="Cache datas time" default="5" values="1|5|15|30|60|120|180|720|1440"/>
</category>
</settings>