1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00
This commit is contained in:
krateng 2022-02-18 09:26:06 +01:00
parent 6b05dde7c0
commit dba31867c6
2 changed files with 6 additions and 3 deletions

View File

@ -323,6 +323,7 @@ def get_scrobbles(since=None,to=None,resolve_references=True):
#result = [scrobble_db_to_dict(row,resolve_references=resolve_references) for i,row in enumerate(result) if i<max] #result = [scrobble_db_to_dict(row,resolve_references=resolve_references) for i,row in enumerate(result) if i<max]
return result return result
@cached_wrapper
def get_artists_of_track(track_id,resolve_references=True): def get_artists_of_track(track_id,resolve_references=True):
with engine.begin() as conn: with engine.begin() as conn:
op = DB['trackartists'].select().where( op = DB['trackartists'].select().where(
@ -503,6 +504,7 @@ def get_artists_map(artist_ids):
### associations ### associations
@cached_wrapper
def get_associated_artists(*artists): def get_associated_artists(*artists):
artist_ids = [get_artist_id(a) for a in artists] artist_ids = [get_artist_id(a) for a in artists]
@ -521,6 +523,7 @@ def get_associated_artists(*artists):
artists = artists_db_to_dict(result) artists = artists_db_to_dict(result)
return artists return artists
@cached_wrapper
def get_credited_artists(*artists): def get_credited_artists(*artists):
artist_ids = [get_artist_id(a) for a in artists] artist_ids = [get_artist_id(a) for a in artists]

View File

@ -147,9 +147,9 @@ malojaconfig = Configuration(
"port":(tp.Integer(), "Port", 42010), "port":(tp.Integer(), "Port", 42010),
}, },
"Technical":{ "Technical":{
"cache_expire_positive":(tp.Integer(), "Image Cache Expiration", 300, "Days until images are refetched"), "cache_expire_positive":(tp.Integer(), "Image Cache Expiration", 300, "Days until images are refetched"),
"cache_expire_negative":(tp.Integer(), "Image Cache Negative Expiration", 30, "Days until failed image fetches are reattempted"), "cache_expire_negative":(tp.Integer(), "Image Cache Negative Expiration", 30, "Days until failed image fetches are reattempted"),
"db_max_memory":(tp.Integer(min=0,max=100), "Database Cache RAM Percentage soft limit", 80, "How much of your total memory Maloja should use for caching. If you don't run the application in a container or dedicated VM, you might want to set this lower.") "db_max_memory":(tp.Integer(min=0,max=100), "RAM Percentage soft limit", 80, "RAM Usage in percent at which Maloja should no longer increase its database cache.")
}, },
"Fluff":{ "Fluff":{
"scrobbles_gold":(tp.Integer(), "Scrobbles for Gold", 250, "How many scrobbles a track needs to be considered 'Gold' status"), "scrobbles_gold":(tp.Integer(), "Scrobbles for Gold", 250, "How many scrobbles a track needs to be considered 'Gold' status"),