refactor: Remove unused playlist routes and related logic; clean up sound and stream models
This commit is contained in:
@@ -82,53 +82,3 @@ def check_ffmpeg():
|
||||
return jsonify(ffmpeg_status), 200
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
|
||||
@bp.route("/list", methods=["GET"])
|
||||
@require_admin
|
||||
def list_sounds():
|
||||
"""Get detailed list of all sounds with normalization status."""
|
||||
from app.services.sound_management_service import SoundManagementService
|
||||
|
||||
return ErrorHandlingService.wrap_service_call(
|
||||
SoundManagementService.get_sounds_with_file_status,
|
||||
request.args.get("type", "SDB"),
|
||||
int(request.args.get("page", 1)),
|
||||
int(request.args.get("per_page", 50)),
|
||||
)
|
||||
|
||||
|
||||
@bp.route("/<int:sound_id>", methods=["DELETE"])
|
||||
@require_admin
|
||||
def delete_sound(sound_id: int):
|
||||
"""Delete a sound and its files."""
|
||||
from app.services.sound_management_service import SoundManagementService
|
||||
|
||||
return ErrorHandlingService.wrap_service_call(
|
||||
SoundManagementService.delete_sound_with_files,
|
||||
sound_id,
|
||||
)
|
||||
|
||||
|
||||
@bp.route("/<int:sound_id>/normalize", methods=["POST"])
|
||||
@require_admin
|
||||
def normalize_single_sound(sound_id: int):
|
||||
"""Normalize a specific sound."""
|
||||
try:
|
||||
from app.services.sound_management_service import SoundManagementService
|
||||
|
||||
data = request.get_json() or {}
|
||||
overwrite = data.get("overwrite", False)
|
||||
two_pass = data.get("two_pass", True)
|
||||
|
||||
result = SoundManagementService.normalize_sound(
|
||||
sound_id,
|
||||
overwrite,
|
||||
two_pass,
|
||||
)
|
||||
|
||||
if result["success"]:
|
||||
return jsonify(result), 200
|
||||
return jsonify(result), 400
|
||||
except Exception as e:
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
Reference in New Issue
Block a user