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:
geoffrey45 committed 2023-01-23 10:19:21 +03:00
1 parent bcc4873766
commit d676459b9a
3 files changed
+40 -27

No files matched your search

-23
View File
@@ -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."}