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:
cwilvx
2024-06-30 15:06:33 +03:00
parent 1a66194c6c
commit 4a9f804e70
53 changed files with 1719 additions and 1353 deletions
+3 -5
View File
@@ -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)