mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
add route to trigger Populate
+ use instance keys to stop multiple instances of populate + move Populate error to a new file + misc
This commit is contained in:
@@ -223,3 +223,18 @@ def set_setting():
|
||||
value = ",".join(value)
|
||||
|
||||
return {"result": value}
|
||||
|
||||
|
||||
@background
|
||||
def run_populate():
|
||||
populate.Populate(instance_key=get_random_str())
|
||||
|
||||
|
||||
@api.route("/settings/trigger-scan", methods=["GET"])
|
||||
def trigger_scan():
|
||||
"""
|
||||
Triggers a scan.
|
||||
"""
|
||||
run_populate()
|
||||
|
||||
return {"msg": "Scan triggered!"}
|
||||
|
||||
Reference in New Issue
Block a user