From fcb705cb0c47a208dc6ec3d401a7346f7917530a Mon Sep 17 00:00:00 2001 From: mungai-njoroge Date: Thu, 14 Sep 2023 21:04:07 +0300 Subject: [PATCH] fix: artist albums always sending all albums + move setproctitle inside if __name__ in manage.py --- app/api/__init__.py | 4 ++-- app/api/artist.py | 2 +- app/api/{track.py => send_file.py} | 0 app/print_help.py | 2 +- manage.py | 9 ++++----- 5 files changed, 8 insertions(+), 9 deletions(-) rename app/api/{track.py => send_file.py} (100%) diff --git a/app/api/__init__.py b/app/api/__init__.py index cb250ba..d9945ae 100644 --- a/app/api/__init__.py +++ b/app/api/__init__.py @@ -15,8 +15,8 @@ from app.api import ( imgserver, playlist, search, + send_file, settings, - track, ) @@ -35,7 +35,7 @@ def create_api(): with app.app_context(): app.register_blueprint(album.api) app.register_blueprint(artist.api) - app.register_blueprint(track.api) + app.register_blueprint(send_file.api) app.register_blueprint(search.api) app.register_blueprint(folder.api) app.register_blueprint(playlist.api) diff --git a/app/api/artist.py b/app/api/artist.py index 141544b..0fae1ee 100644 --- a/app/api/artist.py +++ b/app/api/artist.py @@ -297,7 +297,7 @@ def get_artist_albums(artisthash: str): if artist is None: return {"error": "Artist not found"}, 404 - if return_all is not None: + if return_all is not None and return_all == "true": limit = len(all_albums) return { diff --git a/app/api/track.py b/app/api/send_file.py similarity index 100% rename from app/api/track.py rename to app/api/send_file.py diff --git a/app/print_help.py b/app/print_help.py index 76cc07f..a1c44b6 100644 --- a/app/print_help.py +++ b/app/print_help.py @@ -13,7 +13,7 @@ help_args_list = [ [ "--scan-interval", "-psi", - "Set the periodic scan interval in seconds. Default is 300 seconds (5 minutes)", + "Set the periodic scan interval in seconds. Default is 600 seconds (10 minutes)", ], [ "--build", diff --git a/manage.py b/manage.py index 45b6bb0..6899c78 100644 --- a/manage.py +++ b/manage.py @@ -78,17 +78,16 @@ def start_watchdog(): WatchDog().run() -setproctitle.setproctitle( - f"swingmusic - {FLASKVARS.FLASK_HOST}:{FLASKVARS.FLASK_PORT}" -) - - if __name__ == "__main__": HandleArgs() log_startup_info() bg_run_setup() start_watchdog() + setproctitle.setproctitle( + f"swingmusic - {FLASKVARS.FLASK_HOST}:{FLASKVARS.FLASK_PORT}" + ) + app.run( debug=False, threaded=True,