mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
add route to open a file in file manager
+ try a new approach of cleaning remasters from track titles
This commit is contained in:
+14
-1
@@ -6,13 +6,14 @@ import psutil
|
||||
|
||||
from pathlib import Path
|
||||
from flask import Blueprint, request
|
||||
from showinfm import show_in_file_manager
|
||||
|
||||
from app import settings
|
||||
from app.lib.folderslib import GetFilesAndDirs, get_folders
|
||||
from app.db.sqlite.settings import SettingsSQLMethods as db
|
||||
from app.utils.wintools import win_replace_slash, is_windows
|
||||
|
||||
api = Blueprint("folder", __name__, url_prefix="/")
|
||||
api = Blueprint("folder", __name__, url_prefix="")
|
||||
|
||||
|
||||
@api.route("/folder", methods=["POST"])
|
||||
@@ -116,3 +117,15 @@ def list_folders():
|
||||
return {
|
||||
"folders": sorted(dirs, key=lambda i: i["name"]),
|
||||
}
|
||||
|
||||
|
||||
@api.route("/folder/show-in-files")
|
||||
def open_in_file_manager():
|
||||
path = request.args.get("path")
|
||||
|
||||
if path is None:
|
||||
return {"error": "No path provided."}, 400
|
||||
|
||||
show_in_file_manager(path)
|
||||
|
||||
return {"success": True}
|
||||
|
||||
Reference in New Issue
Block a user