From bf0073fcf8e08abce48f825118a8c2b7fc23bb50 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Tue, 7 Feb 2023 12:40:17 +0300 Subject: [PATCH] feat: mark albums that contain "best of", "greatest hits", "#1 hits", "number ones" as compilations --- app/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 82350212..50d2642a 100644 --- a/app/models.py +++ b/app/models.py @@ -150,7 +150,15 @@ class Album: artists = [a.name for a in self.albumartists] # type: ignore artists = "".join(artists).lower() - return ("various artists" in artists) or self.title.lower().startswith('the essential') + if "various artists" in artists: + return True + + substrings = ["the essential", "best of", "greatest hits", "#1 hits", "number ones"] + for substring in substrings: + if substring in self.title.lower(): + return True + + return False def check_is_ep(self) -> bool: """