From a0cfa765bd06ac8a41e9fe6b48f93ce6ba43ec08 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Sat, 7 Feb 2026 19:25:12 +0300 Subject: [PATCH] Cover replacing for LB --- blueprints/risdeveau/modules/api/lb.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/blueprints/risdeveau/modules/api/lb.py b/blueprints/risdeveau/modules/api/lb.py index 1a658aa..4e9af6f 100644 --- a/blueprints/risdeveau/modules/api/lb.py +++ b/blueprints/risdeveau/modules/api/lb.py @@ -43,6 +43,12 @@ def yt_cover(youtube_url): return f"https://img.youtube.com/vi/{video_id}/2.jpg" def parse_listens(json: dict) -> dict: + cover_replacing = { + "1e699948-c7c8-4bb2-9f8b-62e14b882a5d": "ca464c1d-5848-45bb-b92d-b1e4b00f9d65", + "0d516a93-061e-4a27-9cf7-f36e3a96f888": "5cc0c0c7-22f9-4a4b-a24c-f1a6732f813b", + "92ea5cc8-80e0-4da0-a10b-1bc2f8e8781e": "e8f3e14a-4794-4bab-b403-d562cdad4c2f", + } + new_json = { "count": json["count"], "listens": [] @@ -59,7 +65,11 @@ def parse_listens(json: dict) -> dict: } if mb := track.get("mbid_mapping"): - new_track["id"] = mb.get("caa_release_mbid", mb["release_mbid"]) + new_track["id"] = \ + cover_replacing.get(mb["release_mbid"], + mb.get("caa_release_mbid", + mb["release_mbid"] + )) new_track["artist_name"] = mb["artists"][0]["artist_credit_name"] new_track["track_name"] = mb["recording_name"] elif info := track.get("additional_info"):