0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-27 06:03:52 +01:00

change warning logic

This commit is contained in:
2025-09-01 10:05:13 +02:00
parent b2123f3105
commit bdc82ae5af

View File

@@ -158,8 +158,9 @@ def update_rds(track_name: str):
name_table: dict[str, str] = load_dict_from_custom_format(name_table_path) name_table: dict[str, str] = load_dict_from_custom_format(name_table_path)
try: try:
name = name_table[track_name] name = name_table[track_name]
has_name = True
except KeyError as e: except KeyError as e:
logger.warning(f"File does not have a alias in the name table ({e})") has_name = False
name = track_name.split(".",1)[0] name = track_name.split(".",1)[0]
if " - " in name: if " - " in name:
@@ -172,7 +173,8 @@ def update_rds(track_name: str):
else: else:
artist = rds_default_artist artist = rds_default_artist
title = name title = name
if not has_name: logger.warning(f"File does not have a alias in the name table ({track_name})")
title = unidecode.unidecode(title) title = unidecode.unidecode(title)
artist = unidecode.unidecode(artist) artist = unidecode.unidecode(artist)