fix/bandcamp #12

Merged
Hazel merged 22 commits from fix/bandcamp into experimental 2024-04-23 10:04:52 +00:00
Showing only changes of commit 3c5bbc19af - Show all commits

View File

@ -56,6 +56,7 @@ def fit_to_file_system(string: Union[str, Path]) -> Union[str, Path]:
return fit_string(string)
@lru_cache(maxsize=128)
def clean_song_title(raw_song_title: str, artist_name: Optional[str] = None) -> str:
"""
This function cleans common naming "conventions" for non clean song titles, like the title of youtube videos
@ -76,6 +77,9 @@ def clean_song_title(raw_song_title: str, artist_name: Optional[str] = None) ->
# remove brackets and their content if they contain disallowed substrings
for open_bracket, close_bracket in zip(OPEN_BRACKETS, CLOSE_BRACKETS):
if open_bracket not in raw_song_title or close_bracket not in raw_song_title:
continue
start = 0
while True: