From 49339325860e36914c429102384123a88a649858 Mon Sep 17 00:00:00 2001 From: duck <113956421+duckfromdiscord@users.noreply.github.com> Date: Thu, 7 Sep 2023 23:12:35 -0400 Subject: [PATCH] Add albums to the native API chart function --- maloja/apis/native_v1.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index 422c17f..c6f32b5 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -314,7 +314,23 @@ def get_charts_tracks_external(**keys): "list":result } +@api.get("charts/albums") +@catch_exceptions +@add_common_args_to_docstring(filterkeys=True,limitkeys=True) +def get_charts_albums_external(**keys): + """Returns album charts + :return: list (List) + :rtype: Dictionary""" + k_filter, k_time, _, _, _ = uri_to_internal(keys,forceArtist=True) + ckeys = {**k_filter, **k_time} + + result = database.get_charts_albums(**ckeys) + + return { + "status":"ok", + "list":result + } @api.get("pulse")