Merge branch 'main' into format_separated_string

# Conflicts:
#	ReleaseNotes.md
#	pytest/test_UltraSinger.py
This commit is contained in:
Vadim committed 2023-12-23 22:17:28 +01:00
commit fd975dfb73
3 files changed
+20 -1

No files matched your search

+7 -1
View File
@@ -585,7 +585,7 @@ def create_ultrastar_txt_from_automation(
if artist is not None:
ultrastar_header.artist = artist
if year is not None:
ultrastar_header.year = year
ultrastar_header.year = extract_year(year)
if genre is not None:
ultrastar_header.genre = format_separated_string(genre)
@@ -618,6 +618,12 @@ def create_ultrastar_txt_from_automation(
)
return real_bpm, ultrastar_file_output
def extract_year(date: str) -> str:
match = re.search(r'\b\d{4}\b', date)
if match:
return match.group(0)
else:
return date
def format_separated_string(data: str) -> str:
temp = re.sub(r'[;/]', ',', data)