mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
handle new env vars during build
+ misc
This commit is contained in:
@@ -24,3 +24,19 @@ def activate_deactivate_plugin():
|
||||
PluginsMethods.plugin_set_active(name, int(state))
|
||||
|
||||
return {"message": "OK"}, 200
|
||||
|
||||
|
||||
@api.route("/settings", methods=["POST"])
|
||||
def update_plugin_settings():
|
||||
data = request.get_json()
|
||||
|
||||
plugin = data.get("plugin", None)
|
||||
settings = data.get("settings", None)
|
||||
|
||||
if not plugin or not settings:
|
||||
return {"error": "Missing plugin or settings"}, 400
|
||||
|
||||
PluginsMethods.update_plugin_settings(plugin_name=plugin, settings=settings)
|
||||
plugin = PluginsMethods.get_plugin_by_name(plugin)
|
||||
|
||||
return {"status": "success", "settings": plugin.settings}
|
||||
|
||||
@@ -33,9 +33,6 @@ def search_lyrics():
|
||||
) == create_hash(album):
|
||||
perfect_match = track
|
||||
|
||||
else:
|
||||
track["saved"] = False
|
||||
|
||||
track_id = perfect_match["track_id"]
|
||||
downloaded = finder.download_lyrics(track_id, filepath)
|
||||
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
from flask import Blueprint, request
|
||||
|
||||
from app.db.sqlite.plugins import PluginsMethods as pdb
|
||||
from app.db.sqlite.settings import SettingsSQLMethods as sdb
|
||||
from app.lib import populate
|
||||
from app.lib.watchdogg import Watcher as WatchDog
|
||||
@@ -11,7 +12,7 @@ from app.store.tracks import TrackStore
|
||||
from app.utils.generators import get_random_str
|
||||
from app.utils.threading import background
|
||||
|
||||
api = Blueprint("settings", __name__, url_prefix="/")
|
||||
api = Blueprint("settings", __name__, url_prefix="")
|
||||
|
||||
|
||||
def get_child_dirs(parent: str, children: list[str]):
|
||||
@@ -160,6 +161,7 @@ def get_all_settings():
|
||||
"""
|
||||
|
||||
settings = sdb.get_all_settings()
|
||||
plugins = pdb.get_all_plugins()
|
||||
|
||||
key_list = list(mapp.keys())
|
||||
s = {}
|
||||
@@ -180,6 +182,7 @@ def get_all_settings():
|
||||
|
||||
root_dirs = sdb.get_root_dirs()
|
||||
s["root_dirs"] = root_dirs
|
||||
s['plugins'] = plugins
|
||||
|
||||
return {
|
||||
"settings": s,
|
||||
|
||||
Reference in New Issue
Block a user