mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Fixed silly error
This commit is contained in:
parent
8eb495bbaf
commit
964128fdff
@ -663,8 +663,13 @@ def search(**keys):
|
|||||||
'link': "/album?" + compose_querystring(internal_to_uri({"album":al})),
|
'link': "/album?" + compose_querystring(internal_to_uri({"album":al})),
|
||||||
'image': images.get_album_image(al)
|
'image': images.get_album_image(al)
|
||||||
}
|
}
|
||||||
if not result['album']['artists']: result['album']['displayArtist'] = malojaconfig["DEFAULT_ALBUM_ARTIST"]
|
mutable_result = result.copy()
|
||||||
albums_result.append(result)
|
mutable_result['album'] = result['album'].copy()
|
||||||
|
if not mutable_result['album']['artists']: mutable_result['album']['displayArtist'] = malojaconfig["DEFAULT_ALBUM_ARTIST"]
|
||||||
|
# we don't wanna actually mutate the dict here because this is in the cache
|
||||||
|
# TODO: This should be globally solved!!!!! immutable dicts with mutable overlays???
|
||||||
|
# this is a major flaw in the architecture!
|
||||||
|
albums_result.append(mutable_result)
|
||||||
|
|
||||||
return {"artists":artists_result[:max_],"tracks":tracks_result[:max_],"albums":albums_result[:max_]}
|
return {"artists":artists_result[:max_],"tracks":tracks_result[:max_],"albums":albums_result[:max_]}
|
||||||
|
|
||||||
|
@ -721,14 +721,9 @@ def album_info(dbconn=None,**keys):
|
|||||||
|
|
||||||
#scrobbles = get_scrobbles_num(track=track,timerange=alltime())
|
#scrobbles = get_scrobbles_num(track=track,timerange=alltime())
|
||||||
|
|
||||||
try:
|
|
||||||
c = [e for e in alltimecharts if e["album"] == album][0]
|
c = [e for e in alltimecharts if e["album"] == album][0]
|
||||||
scrobbles = c["scrobbles"]
|
scrobbles = c["scrobbles"]
|
||||||
position = c["rank"]
|
position = c["rank"]
|
||||||
except IndexError as e:
|
|
||||||
log(f"Error while finding album chart position for {album}",module="debug_special")
|
|
||||||
log(f"{e}",module="debug_special")
|
|
||||||
scrobbles, position = 0,0
|
|
||||||
|
|
||||||
|
|
||||||
cert = None
|
cert = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user