Add a top album function to the native API

This commit is contained in:
duck 2023-09-07 22:47:19 -04:00
parent e328ae48f3
commit ec77ee6091

View File

@ -400,7 +400,23 @@ def get_top_tracks_external(**keys):
"list":results
}
@api.get("top/albums")
@catch_exceptions
@add_common_args_to_docstring(limitkeys=True,delimitkeys=True)
def get_top_albums_external(**keys):
"""Returns respective number 1 albums in specified time frames
:return: list (List)
:rtype: Dictionary"""
_, k_time, k_internal, _, _ = uri_to_internal(keys)
ckeys = {**k_time, **k_internal}
results = database.get_top_albums(**ckeys)
return {
"status":"ok",
"list":results
}
@api.get("artistinfo")