rename run_app to create_app

This commit is contained in:
cwilvx
2025-05-25 19:09:57 +03:00
parent f4bc525ae4
commit 76fc97e088
6 changed files with 3 additions and 2813 deletions
-13
View File
@@ -1,13 +0,0 @@
# TODO
A list of things to do. Feel free to grab one of this and work on it.
## Clean up old playlist images
When playlists are deleted or their images updated, the old
images are not deleted.
Write a function to:
- read all images in the playlist image directory and checks unlinked images by comparing the list with the .image property of each property
- delete unlinked images
The function can run on app start up, before periodic checks
-15
View File
@@ -1,15 +0,0 @@
from locust import HttpUser, task
class HelloWorldUser(HttpUser):
host = "http://localhost:1980"
# @task
# def get_all_artists(self):
# self.client.get(
# "/getall/artists?start=0&limit=50&sortby=created_date&reverse=1"
# )
@task
def get_album_info(self):
self.client.get("/artist/9e6781427eab4934")
+2 -2
View File
@@ -6,7 +6,7 @@ import multiprocessing
from app.arg_handler import handle_build, handle_password_reset from app.arg_handler import handle_build, handle_password_reset
from app.utils.filesystem import get_home_res_path from app.utils.filesystem import get_home_res_path
from app.utils.xdg_utils import get_xdg_config_dir from app.utils.xdg_utils import get_xdg_config_dir
from manage import run_app from manage import create_app
def version(*args, **kwargs): def version(*args, **kwargs):
@@ -71,7 +71,7 @@ def run(*args, **kwargs):
os.environ["SWINGMUSIC_XDG_CONFIG_DIR"] = str( os.environ["SWINGMUSIC_XDG_CONFIG_DIR"] = str(
pathlib.Path(kwargs["config"]).resolve() pathlib.Path(kwargs["config"]).resolve()
) )
run_app(kwargs["host"], kwargs["port"], kwargs["config"]) create_app(kwargs["host"], kwargs["port"], kwargs["config"])
if __name__ == "__main__": if __name__ == "__main__":
+1 -1
View File
@@ -29,7 +29,7 @@ from app.utils.filesystem import get_home_res_path
from app.utils.paths import getClientFilesExtensions from app.utils.paths import getClientFilesExtensions
def run_app(host: str, port: int, config: Path): def create_app(host: str, port: int, config: Path):
# settings.Paths.set_config_dir(config) # settings.Paths.set_config_dir(config)
# Load mimetypes for the web client's static files # Load mimetypes for the web client's static files
-4
View File
@@ -1,4 +0,0 @@
{
"age": 45,
"name": "Johniee"
}
Generated
-2778
View File
File diff suppressed because it is too large Load Diff