drop global XDG_CONFIG_DIR and use environment variables

+ handle string explicit flags
This commit is contained in:
cwilvx
2025-05-25 19:01:10 +03:00
parent 4a741d9ffc
commit f4bc525ae4
7 changed files with 152 additions and 28 deletions
+8 -1
View File
@@ -84,8 +84,15 @@ class Track:
self.og_album = self.album
self.folder = self.folder + "/"
self.weakhash = create_hash(self.title, self.artists)
explicit_tag = self.extra.get("explicit", ["0"])
self.explicit = int(explicit_tag[0]) == 1
if isinstance(explicit_tag, list):
explicit_tag = explicit_tag[0] if explicit_tag else "0"
if isinstance(explicit_tag, str):
explicit_tag = explicit_tag.lower()
self.explicit = explicit_tag in ("1", "yes", "true")
else:
self.explicit = bool(explicit_tag)
self.image = self.albumhash + ".webp" + "?pathhash=" + self.pathhash
# self.extra = {