mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Fix GH-251
This commit is contained in:
parent
7c5099da8d
commit
b64771b5c9
@ -305,6 +305,7 @@ def get_charts_tracks_external(**keys):
|
|||||||
:return: list (List)
|
:return: list (List)
|
||||||
:rtype: Dictionary"""
|
:rtype: Dictionary"""
|
||||||
k_filter, k_time, _, _, _ = uri_to_internal(keys,forceArtist=True)
|
k_filter, k_time, _, _, _ = uri_to_internal(keys,forceArtist=True)
|
||||||
|
# force artist because track charts can never be of a track or album, only of an artist or global
|
||||||
ckeys = {**k_filter, **k_time}
|
ckeys = {**k_filter, **k_time}
|
||||||
|
|
||||||
result = database.get_charts_tracks(**ckeys)
|
result = database.get_charts_tracks(**ckeys)
|
||||||
|
@ -12,14 +12,18 @@ def uri_to_internal(keys,forceTrack=False,forceArtist=False,forceAlbum=False,api
|
|||||||
# 3 keys that define interal time ranges
|
# 3 keys that define interal time ranges
|
||||||
# 4 keys that define amount limits
|
# 4 keys that define amount limits
|
||||||
|
|
||||||
type = None
|
# if we force a type, that only means that the other types are not allowed
|
||||||
if forceTrack: type = "track"
|
# it could still have no type at all (any call that isn't filtering by entity)
|
||||||
if forceArtist: type = "artist"
|
|
||||||
if forceAlbum: type = "album"
|
|
||||||
|
|
||||||
if not type and "title" in keys: type = "track"
|
type = None
|
||||||
if not type and "albumtitle" in keys: type = "album"
|
if forceTrack and "title" in keys: type = "track"
|
||||||
if not type and "artist" in keys: type = "artist"
|
if forceArtist and "artist" in keys: type = "artist"
|
||||||
|
if forceAlbum and "albumtitle" in keys: type = "album"
|
||||||
|
|
||||||
|
if (not forceTrack) and (not forceAlbum) and (not forceArtist) and (not type):
|
||||||
|
if "title" in keys: type = "track"
|
||||||
|
if "albumtitle" in keys: type = "album"
|
||||||
|
if "artist" in keys: type = "artist"
|
||||||
|
|
||||||
# 1
|
# 1
|
||||||
if type == "track":
|
if type == "track":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user