diff --git a/maloja/images.py b/maloja/images.py index ec07a73..3b60c4c 100644 --- a/maloja/images.py +++ b/maloja/images.py @@ -92,7 +92,9 @@ def get_image_from_cache(track_id=None,artist_id=None,album_id=None): elif row.localproxyurl: return {'type':'localurl','value':row.localproxyurl} 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 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: 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']) finally: with image_resolve_controller_lock: diff --git a/maloja/web/jinja/snippets/filterdescription.jinja b/maloja/web/jinja/snippets/filterdescription.jinja index 4a5135f..5652970 100644 --- a/maloja/web/jinja/snippets/filterdescription.jinja +++ b/maloja/web/jinja/snippets/filterdescription.jinja @@ -8,7 +8,7 @@ of {{ links.link(filterkeys.get('track')) }} by {{ links.links(filterkeys["track"]["artists"]) }} {% 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"]) }} {% endif %} {{ limitkeys.timerange.desc(prefix=True) }}