mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
feat: if no root dir is set, try ~/Music
if there's music in there, add it as a root dir
This commit is contained in:
@@ -51,26 +51,3 @@ def get_root_dirs():
|
||||
dirs = sdb.get_root_dirs()
|
||||
|
||||
return {"dirs": dirs}
|
||||
|
||||
|
||||
# CURRENTLY UNUSED ROUTE 👇
|
||||
@api.route("/settings/remove-root-dirs", methods=["POST"])
|
||||
def remove_root_dirs():
|
||||
"""
|
||||
Remove custom root directories from the database.
|
||||
"""
|
||||
msg = {"msg": "Failed! No directories were given."}
|
||||
|
||||
data = request.get_json()
|
||||
|
||||
if data is None:
|
||||
return msg, 400
|
||||
|
||||
try:
|
||||
dirs = data["dirs"]
|
||||
except KeyError:
|
||||
return msg, 400
|
||||
|
||||
sdb.remove_root_dirs(dirs)
|
||||
|
||||
return {"msg": "Removed root directories from the database."}
|
||||
|
||||
Reference in New Issue
Block a user