mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added setting not to use local images
This commit is contained in:
parent
c3515080ae
commit
549fc09e7b
@ -14,4 +14,5 @@ CACHE_EXPIRE_POSITIVE = 300 # after how many days positive results should be ref
|
||||
|
||||
[Local Images]
|
||||
|
||||
USE_LOCAL_IMAGES = true
|
||||
LOCAL_IMAGE_ROTATE = 3600 # when multiple images are present locally, how many seconds we wait between rotation
|
||||
|
10
utilities.py
10
utilities.py
@ -286,6 +286,8 @@ def getTrackImage(artists,title,fast=False):
|
||||
# if filename == "": filename = str(hash(obj))
|
||||
# filepath = "images/tracks/" + filename
|
||||
|
||||
if settings.get_settings("USE_LOCAL_IMAGES"):
|
||||
|
||||
try:
|
||||
return local_track_cache.get((frozenset(artists),title))
|
||||
except:
|
||||
@ -359,6 +361,8 @@ def getArtistImage(artist,fast=False):
|
||||
# filepath = "images/artists/" + filename
|
||||
# #filepath_cache = "info/artists_cache/" + filename
|
||||
|
||||
if settings.get_settings("USE_LOCAL_IMAGES"):
|
||||
|
||||
try:
|
||||
return local_artist_cache.get(artist)
|
||||
except:
|
||||
@ -511,9 +515,3 @@ def update_medals():
|
||||
elif t["rank"] == 2: MEDALS_TRACKS.setdefault(track,{}).setdefault("silver",[]).append(year)
|
||||
elif t["rank"] == 3: MEDALS_TRACKS.setdefault(track,{}).setdefault("bronze",[]).append(year)
|
||||
else: break
|
||||
|
||||
|
||||
@daily
|
||||
def scheduletest():
|
||||
|
||||
log("New day!",module="debug")
|
||||
|
Loading…
Reference in New Issue
Block a user