diff --git a/swingmusic/config.py b/swingmusic/config.py index 1f21af75..82ef8453 100644 --- a/swingmusic/config.py +++ b/swingmusic/config.py @@ -41,6 +41,7 @@ def load_user_artist_ignore_list() -> set[str]: @dataclass class UserConfig: _config_path: str = "" + _artist_split_ignore_file_name: str = "artist_split_ignore.txt" # NOTE: only auth stuff are used (the others are still reading/writing to db) # TODO: Move the rest of the settings to the config file diff --git a/swingmusic/data/artist_split_ignore.txt b/swingmusic/data/artist_split_ignore.txt index ed860cf4..768158cd 100644 --- a/swingmusic/data/artist_split_ignore.txt +++ b/swingmusic/data/artist_split_ignore.txt @@ -5,4 +5,5 @@ Smith & Thell Peter, Paul & Mary Simon & Garfunkel Judy & Mary -Florence & The Machine \ No newline at end of file +Florence & The Machine +Belle & Sebastian \ No newline at end of file diff --git a/swingmusic/setup/files.py b/swingmusic/setup/files.py index 963f3d40..3bc73b01 100644 --- a/swingmusic/setup/files.py +++ b/swingmusic/setup/files.py @@ -4,9 +4,11 @@ create the config directory and copy the assets to the app directory. """ import os +from pathlib import Path import shutil from swingmusic import settings +from swingmusic.config import UserConfig from swingmusic.utils.filesystem import get_home_res_path @@ -62,7 +64,6 @@ def create_config_dir() -> None: playlist_img_path = os.path.join("images", "playlists") - mixes_img_path = settings.Paths.get_mixes_img_path() og_mixes_img_path = settings.Paths.get_og_mixes_img_path() md_mixes_img_path = settings.Paths.get_md_mixes_img_path() @@ -85,8 +86,8 @@ def create_config_dir() -> None: sm_mixes_img_path, ] - for _dir in dirs: - path = os.path.join(settings.Paths.get_app_dir(), _dir) + for dir in dirs: + path = os.path.join(settings.Paths.get_app_dir(), dir) exists = os.path.exists(path) if not exists: @@ -94,5 +95,15 @@ def create_config_dir() -> None: os.makedirs(path, exist_ok=True) os.chmod(path, 0o755) + # Empty files to create + empty_files = [ + # artist split ignore list + Path(settings.Paths.get_app_dir()) / UserConfig._artist_split_ignore_file_name, + ] + + for file in empty_files: + if not file.exists(): + file.touch() + # copy assets to the app directory CopyFiles()