diff --git a/maloja/database/sqldb.py b/maloja/database/sqldb.py index abeb3de..0728192 100644 --- a/maloja/database/sqldb.py +++ b/maloja/database/sqldb.py @@ -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] return result +@cached_wrapper def get_artists_of_track(track_id,resolve_references=True): with engine.begin() as conn: op = DB['trackartists'].select().where( @@ -503,6 +504,7 @@ def get_artists_map(artist_ids): ### associations +@cached_wrapper def get_associated_artists(*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) return artists +@cached_wrapper def get_credited_artists(*artists): artist_ids = [get_artist_id(a) for a in artists] diff --git a/maloja/globalconf.py b/maloja/globalconf.py index c1d0170..19c76c7 100644 --- a/maloja/globalconf.py +++ b/maloja/globalconf.py @@ -147,9 +147,9 @@ malojaconfig = Configuration( "port":(tp.Integer(), "Port", 42010), }, "Technical":{ - "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"), - "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.") + "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"), + "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":{ "scrobbles_gold":(tp.Integer(), "Scrobbles for Gold", 250, "How many scrobbles a track needs to be considered 'Gold' status"),