mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
combine userdata and swing db into one
+ port populate to new db interface
+ add genrehashes and hash info to tracks
+ properly structure new db table files
+ move helpers to dedicated utils file
+ move settings from db to config file
+ move artists, albums, auth and favorites endpoint to new db interface
+ use folder store to index filepaths
+ paginate favorite pages
+ 56 moretiny changes 😅
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import re
|
||||
|
||||
from app.enums.album_versions import AlbumVersionEnum, get_all_keywords
|
||||
from app.settings import SessionVarKeys, get_flag
|
||||
|
||||
|
||||
def split_artists(src: str):
|
||||
def split_artists(src: str, separators: set[str]):
|
||||
"""
|
||||
Splits a string of artists into a list of artists.
|
||||
"""
|
||||
separators: set = get_flag(SessionVarKeys.ARTIST_SEPARATORS)
|
||||
for sep in separators:
|
||||
src = src.replace(sep, ",")
|
||||
|
||||
@@ -38,7 +36,7 @@ def remove_prod(title: str) -> str:
|
||||
return title.strip()
|
||||
|
||||
|
||||
def parse_feat_from_title(title: str) -> tuple[list[str], str]:
|
||||
def parse_feat_from_title(title: str, separators: set[str]) -> tuple[list[str], str]:
|
||||
"""
|
||||
Extracts featured artists from a song title using regex.
|
||||
"""
|
||||
@@ -56,7 +54,7 @@ def parse_feat_from_title(title: str) -> tuple[list[str], str]:
|
||||
return [], title
|
||||
|
||||
artists = match.group(1)
|
||||
artists = split_artists(artists)
|
||||
artists = split_artists(artists, separators)
|
||||
|
||||
# remove "feat" group from title
|
||||
new_title = re.sub(regex, "", title, flags=re.IGNORECASE)
|
||||
|
||||
Reference in New Issue
Block a user