mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Smol fixes
This commit is contained in:
parent
0be122afb6
commit
8fcc1ae847
@ -92,7 +92,9 @@ def get_image_from_cache(track_id=None,artist_id=None,album_id=None):
|
|||||||
elif row.localproxyurl:
|
elif row.localproxyurl:
|
||||||
return {'type':'localurl','value':row.localproxyurl}
|
return {'type':'localurl','value':row.localproxyurl}
|
||||||
else:
|
else:
|
||||||
return {'type':'url','value':row.url} # returns None as value if nonexistence cached
|
return {'type':'url','value':row.url or None}
|
||||||
|
# value none means nonexistence is cached
|
||||||
|
# for some reason this can also be an empty string, so use or None here to unify
|
||||||
return None # no cache entry
|
return None # no cache entry
|
||||||
|
|
||||||
def set_image_in_cache(url,track_id=None,artist_id=None,album_id=None,local=False):
|
def set_image_in_cache(url,track_id=None,artist_id=None,album_id=None,local=False):
|
||||||
@ -260,7 +262,7 @@ def resolve_image(artist_id=None,track_id=None,album_id=None):
|
|||||||
elif album_id:
|
elif album_id:
|
||||||
result = thirdparty.get_image_album_all((entity['artists'],entity['albumtitle']))
|
result = thirdparty.get_image_album_all((entity['artists'],entity['albumtitle']))
|
||||||
|
|
||||||
result = {'type':'url','value':result}
|
result = {'type':'url','value':result or None}
|
||||||
set_image_in_cache(artist_id=artist_id,track_id=track_id,album_id=album_id,url=result['value'])
|
set_image_in_cache(artist_id=artist_id,track_id=track_id,album_id=album_id,url=result['value'])
|
||||||
finally:
|
finally:
|
||||||
with image_resolve_controller_lock:
|
with image_resolve_controller_lock:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
of {{ links.link(filterkeys.get('track')) }}
|
of {{ links.link(filterkeys.get('track')) }}
|
||||||
by {{ links.links(filterkeys["track"]["artists"]) }}
|
by {{ links.links(filterkeys["track"]["artists"]) }}
|
||||||
{% elif filterkeys.get('album') is not none %}
|
{% elif filterkeys.get('album') is not none %}
|
||||||
of {{ links.link(filterkeys.get('album')) }}
|
from {{ links.link(filterkeys.get('album')) }}
|
||||||
by {{ links.links(filterkeys["album"]["artists"]) }}
|
by {{ links.links(filterkeys["album"]["artists"]) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ limitkeys.timerange.desc(prefix=True) }}
|
{{ limitkeys.timerange.desc(prefix=True) }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user