From f512b65312e1337f09021f9aa60e0498d9e4632b Mon Sep 17 00:00:00 2001 From: cwilvx Date: Tue, 29 Oct 2024 02:00:28 +0300 Subject: [PATCH] prevent artist mix duplicates --- app/plugins/mixes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/plugins/mixes.py b/app/plugins/mixes.py index 806e61bd..5adac0b7 100644 --- a/app/plugins/mixes.py +++ b/app/plugins/mixes.py @@ -138,7 +138,13 @@ class MixesPlugin(Plugin): if previous_period["created"] < previous_period["max"]: limit += previous_period["max"] - previous_period["created"] - for artist in period["artists"][:limit]: + for artist in period["artists"]: + if period["created"] >= limit: + break + + if artist["artisthash"] in indexed: + continue + mix = self.create_artist_mix(artist) if mix: