Some cleanup
This commit is contained in:
parent
f587d3d4d6
commit
4980752fd0
12
service.py
12
service.py
|
@ -19,7 +19,7 @@ mb = None
|
||||||
|
|
||||||
serviceEnabled = True
|
serviceEnabled = True
|
||||||
|
|
||||||
refresh_age = 3600 #multiple of random to age info records - needs some validation
|
refresh_age = 86400#3600 #multiple of random to age info records - needs some validation
|
||||||
check_freq = 30 #How often to run a refresh cycle - needs some validation
|
check_freq = 30 #How often to run a refresh cycle - needs some validation
|
||||||
|
|
||||||
db_filename = "subsonic_sqlite.db"
|
db_filename = "subsonic_sqlite.db"
|
||||||
|
@ -143,12 +143,12 @@ def check_db_status():
|
||||||
for artist in current_index_content["artist"]:
|
for artist in current_index_content["artist"]:
|
||||||
artist_id = artist['id']
|
artist_id = artist['id']
|
||||||
record_age = db.get_record_age(artist_id)
|
record_age = db.get_record_age(artist_id)
|
||||||
plugin.log("Record age %s vs %s for %s"%(record_age, (random.randint(1,111)*refresh_age), artist_id))
|
rnd_age = random.randint(1,111)*refresh_age
|
||||||
if(not record_age or (record_age > (random.randint(1,111)*refresh_age))):
|
#plugin.log("Record age %s vs %s for %s"%(record_age, rnd_age, artist_id))
|
||||||
plugin.log("Record age %s vs %s for %s"%(record_age, (random.randint(1,111)*refresh_age), artist_id))
|
if(not record_age or (record_age > rnd_age)):
|
||||||
plugin.log("Refreshing %s" % (artist_id))
|
#plugin.log("Refreshing %s" % (artist_id))
|
||||||
refresh_artist(artist_id)
|
refresh_artist(artist_id)
|
||||||
plugin.log("Refresh complete for %s" % (artist_id))
|
#plugin.log("Refresh complete for %s" % (artist_id))
|
||||||
plugin.log("Finished info loading for index %s"%current_index_content['name'])
|
plugin.log("Finished info loading for index %s"%current_index_content['name'])
|
||||||
current_artist_index+=1
|
current_artist_index+=1
|
||||||
if(current_artist_index>=len(response["artists"]["index"])):current_artist_index=0
|
if(current_artist_index>=len(response["artists"]["index"])):current_artist_index=0
|
||||||
|
|
Loading…
Reference in New Issue