fixed track name

This commit is contained in:
Alexander Karpov 2024-01-18 23:10:12 +03:00
parent b76a40aa02
commit d3b1fe5fa1

View File

@ -56,11 +56,13 @@ def load_track(
os.remove(search_info["album_image"]) os.remove(search_info["album_image"])
if "title" in search_info: if "title" in search_info:
title = re.sub(r"\W+", "", search_info["title"]).lower() title = re.sub(r"\W+", "", search_info["title"]).lower()
name_clean = re.sub(r"\W+", "", name).lower() name_clean = re.sub(r"\W+", "", orig_name).lower()
# Check if title is in name # Check if title is in name
if title in name_clean: if title in name_clean:
name = search_info["title"] name = search_info["title"]
elif name:
name = name
else: else:
name = process_track_name(" ".join(p_name.strip().split("-"))) name = process_track_name(" ".join(p_name.strip().split("-")))