mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
check todo at api/folder.py line:60
~ everything seems to work fine in Windows too + move ProcessArtistColors to Populate
This commit is contained in:
+5
-7
@@ -56,8 +56,9 @@ def get_folder_tree():
|
||||
}
|
||||
|
||||
if is_windows():
|
||||
# Trailing slash needed when drive letters are passed,
|
||||
# Remember, the trailing slash is removed in the client.
|
||||
req_dir = req_dir + "/"
|
||||
# TODO: Test this on Windows
|
||||
else:
|
||||
req_dir = "/" + req_dir + "/" if not req_dir.startswith("/") else req_dir + "/"
|
||||
|
||||
@@ -96,16 +97,13 @@ def list_folders():
|
||||
try:
|
||||
req_dir: str = data["folder"]
|
||||
except KeyError:
|
||||
req_dir = "$home"
|
||||
req_dir = "$root"
|
||||
|
||||
if req_dir == "$home":
|
||||
if req_dir == "$root":
|
||||
# req_dir = settings.USER_HOME_DIR
|
||||
# if is_win:
|
||||
return {
|
||||
"folders": [
|
||||
{"name": d, "path": d}
|
||||
for d in get_all_drives(is_win=is_win)
|
||||
]
|
||||
"folders": [{"name": d, "path": d} for d in get_all_drives(is_win=is_win)]
|
||||
}
|
||||
|
||||
if is_win:
|
||||
|
||||
@@ -36,6 +36,4 @@ def run_periodic_checks():
|
||||
"Internet connection lost. Downloading artist images stopped."
|
||||
)
|
||||
|
||||
ProcessArtistColors()
|
||||
|
||||
time.sleep(300)
|
||||
|
||||
+3
-1
@@ -6,7 +6,7 @@ from app.db.sqlite.tracks import SQLiteTrackMethods
|
||||
from app.db.sqlite.settings import SettingsSQLMethods as sdb
|
||||
from app.db.sqlite.favorite import SQLiteFavoriteMethods as favdb
|
||||
from app.db.store import Store
|
||||
from app.lib.colorlib import ProcessAlbumColors
|
||||
from app.lib.colorlib import ProcessAlbumColors, ProcessArtistColors
|
||||
|
||||
from app.lib.taglib import extract_thumb, get_tags
|
||||
from app.logger import log
|
||||
@@ -70,6 +70,8 @@ class Populate:
|
||||
|
||||
ProcessTrackThumbnails()
|
||||
ProcessAlbumColors()
|
||||
ProcessArtistColors()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def filter_untagged(tracks: list[Track], files: list[str]):
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ def get_tags(filepath: str):
|
||||
else:
|
||||
setattr(tags, tag, "Unknown")
|
||||
|
||||
# TODO: Move parsing title, album and artist to startup.
|
||||
# TODO: Move parsing title, album and artist to startup. (Maybe!)
|
||||
|
||||
to_check = ["album", "year", "albumartist"]
|
||||
for prop in to_check:
|
||||
|
||||
@@ -280,5 +280,5 @@ class Handler(PatternMatchingEventHandler):
|
||||
add_track(path)
|
||||
self.files_to_process_windows.remove(event.src_path)
|
||||
except OSError:
|
||||
print("File is locked, skipping")
|
||||
# File is locked, skipping
|
||||
pass
|
||||
|
||||
+4
-4
@@ -28,13 +28,13 @@ def get_xdg_config_dir():
|
||||
# ------- HELPER METHODS --------
|
||||
|
||||
|
||||
APP_VERSION = "Swing v.1.0.0.beta.1"
|
||||
APP_VERSION = "v.1.1.0.beta"
|
||||
|
||||
# paths
|
||||
XDG_CONFIG_DIR = get_xdg_config_dir()
|
||||
USER_HOME_DIR = os.path.expanduser("~")
|
||||
|
||||
CONFIG_FOLDER = "swing" if XDG_CONFIG_DIR != USER_HOME_DIR else ".swing"
|
||||
CONFIG_FOLDER = "swingmusic" if XDG_CONFIG_DIR != USER_HOME_DIR else ".swingmusic"
|
||||
|
||||
APP_DIR = os.path.join(XDG_CONFIG_DIR, CONFIG_FOLDER)
|
||||
IMG_PATH = os.path.join(APP_DIR, "images")
|
||||
@@ -90,8 +90,8 @@ Options:
|
||||
|
||||
EXTRACT_FEAT = True
|
||||
"""
|
||||
Whether to extract the featured artists from the song title
|
||||
Changed using the --no-feat flag
|
||||
Whether to extract the featured artists from the song title.
|
||||
Changed using the `--no-feat` flag
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user