diff --git a/TODO.md b/TODO.md index 1dbe7a85..9014d561 100644 --- a/TODO.md +++ b/TODO.md @@ -56,4 +56,3 @@ - Duplicates on search - Audio stops on ending -- Port account settings to config on the frontend \ No newline at end of file diff --git a/app/api/auth.py b/app/api/auth.py index 0cf41bf1..de36e78a 100644 --- a/app/api/auth.py +++ b/app/api/auth.py @@ -14,7 +14,6 @@ from pydantic import BaseModel, Field from flask_openapi3 import Tag from flask_openapi3 import APIBlueprint -# from app.db.sqlite.auth import SQLiteAuthMethods as authdb from app.db.userdata import UserTable from app.utils.auth import check_password, hash_password from app.config import UserConfig @@ -307,8 +306,6 @@ def get_all_users(query: GetAllUsersQuery): Get all users (if you're an admin, you will also receive accounts settings) """ config = UserConfig() - # config.enableGuest = True - # config.usersOnLogin = True settings = { "enableGuest": False, "usersOnLogin": config.usersOnLogin, diff --git a/app/api/playlist.py b/app/api/playlist.py index a437bf8f..8ba74cdb 100644 --- a/app/api/playlist.py +++ b/app/api/playlist.py @@ -200,6 +200,11 @@ def get_playlist(path: PlaylistIDPath, query: GetPlaylistQuery): is_custom = playlistid in {p["name"] for p in custom_playlists} if is_custom: + if query.start != 0: + return { + "tracks": [], + } + handler = next( p["handler"] for p in custom_playlists if p["name"] == playlistid ) diff --git a/app/api/settings.py b/app/api/settings.py index 09a5727d..561c7395 100644 --- a/app/api/settings.py +++ b/app/api/settings.py @@ -6,14 +6,12 @@ from pydantic import BaseModel, Field from app.api.auth import admin_required from app.db.userdata import PluginTable -from app.lib.index import IndexEverything, index_everything +from app.lib.index import index_everything from app.logger import log -from app.settings import Info, SessionVarKeys +from app.settings import Info from app.store.albums import AlbumStore from app.store.artists import ArtistStore from app.store.tracks import TrackStore -from app.utils.generators import get_random_str -from app.utils.threading import background from app.config import UserConfig bp_tag = Tag(name="Settings", description="Customize stuff") @@ -154,15 +152,15 @@ def get_root_dirs(): # maps settings to their parser flags -mapp = { - "artist_separators": SessionVarKeys.ARTIST_SEPARATORS, - "extract_feat": SessionVarKeys.EXTRACT_FEAT, - "remove_prod": SessionVarKeys.REMOVE_PROD, - "clean_album_title": SessionVarKeys.CLEAN_ALBUM_TITLE, - "remove_remaster": SessionVarKeys.REMOVE_REMASTER_FROM_TRACK, - "merge_albums": SessionVarKeys.MERGE_ALBUM_VERSIONS, - "show_albums_as_singles": SessionVarKeys.SHOW_ALBUMS_AS_SINGLES, -} +# mapp = { +# "artist_separators": SessionVarKeys.ARTIST_SEPARATORS, +# "extract_feat": SessionVarKeys.EXTRACT_FEAT, +# "remove_prod": SessionVarKeys.REMOVE_PROD, +# "clean_album_title": SessionVarKeys.CLEAN_ALBUM_TITLE, +# "remove_remaster": SessionVarKeys.REMOVE_REMASTER_FROM_TRACK, +# "merge_albums": SessionVarKeys.MERGE_ALBUM_VERSIONS, +# "show_albums_as_singles": SessionVarKeys.SHOW_ALBUMS_AS_SINGLES, +# } @api.get("") @@ -178,9 +176,9 @@ def get_all_settings(): return config -@background -def reload_all_for_set_setting(): - reload_everything(get_random_str()) +# @background +# def reload_all_for_set_setting(): +# reload_everything(get_random_str()) class SetSettingBody(BaseModel): @@ -227,19 +225,12 @@ class SetSettingBody(BaseModel): # return {"result": value} - -@background -def index_stuff(): - IndexEverything() - pass - - @api.get("/trigger-scan") def trigger_scan(): """ Triggers scan for new music """ - index_stuff() + index_everything() return {"msg": "Scan triggered!"} diff --git a/app/settings.py b/app/settings.py index 4534a1c9..1320454e 100644 --- a/app/settings.py +++ b/app/settings.py @@ -5,7 +5,6 @@ Contains default configs import os import subprocess import sys -from typing import Any from app import configs @@ -231,20 +230,6 @@ class SessionVars: SHOW_ALBUMS_AS_SINGLES = False -# TODO: Find a way to eliminate this class without breaking typings -class SessionVarKeys: - EXTRACT_FEAT = "EXTRACT_FEAT" - REMOVE_PROD = "REMOVE_PROD" - CLEAN_ALBUM_TITLE = "CLEAN_ALBUM_TITLE" - REMOVE_REMASTER_FROM_TRACK = "REMOVE_REMASTER_FROM_TRACK" - DO_PERIODIC_SCANS = "DO_PERIODIC_SCANS" - PERIODIC_SCAN_INTERVAL = "PERIODIC_SCAN_INTERVAL" - MERGE_ALBUM_VERSIONS = "MERGE_ALBUM_VERSIONS" - ARTIST_SEPARATORS = "ARTIST_SEPARATORS" - SHOW_ALBUMS_AS_SINGLES = "SHOW_ALBUMS_AS_SINGLES" - - - class TCOLOR: """ Terminal colors