add silence removal using pydub and multithreading

+ fix favorites endpoint returning items less than limit
+ add endpoint to remove get silence padding
+ add 'the ulitimate' and 'compilation' to compilation album filters
+ misc
This commit is contained in:
mungai-njoroge
2024-01-05 01:08:07 +03:00
parent 6d6c86cb93
commit 258897b649
28 changed files with 4949 additions and 24 deletions
+13
View File
@@ -4,6 +4,7 @@ Contains all the track routes.
import os
from flask import Blueprint, send_file, request
from app.lib.trackslib import get_silence_paddings
from app.store.tracks import TrackStore
@@ -53,3 +54,15 @@ def send_track_file(trackhash: str):
return msg, 404
return msg, 404
@api.route("/file/silence", methods=["POST"])
def get_audio_silence():
data = request.get_json()
ending_file = data.get("end", None) # ending file's filepath
starting_file = data.get("start", None) # starting file's filepath
if ending_file is None or starting_file is None:
return {"msg": "No filepath provided"}, 400
return get_silence_paddings(ending_file, starting_file)