refact (core): simplifies constants.py, removes redundancy, updates dependent code
This commit is contained in:
@@ -9,7 +9,7 @@ from backend.services.task_manager import task_manager
|
||||
# Import core functions
|
||||
from audio_splitter.ffmpeg import get_stream_info, get_container_format, get_audio_codec
|
||||
from audio_splitter.formats import determine_default_format
|
||||
from audio_splitter.constants import FORMAT_INFO
|
||||
from audio_splitter.constants import CONTAINER_NAMES
|
||||
from audio_splitter.defaults import DEFAULT_FORMAT
|
||||
|
||||
router = APIRouter(prefix="/api", tags=["info"])
|
||||
@@ -63,7 +63,7 @@ async def get_recommended_format(task_id: str):
|
||||
# Fallback if detection fails or format is unsupported
|
||||
if fmt is None:
|
||||
fmt = DEFAULT_FORMAT
|
||||
if fmt not in FORMAT_INFO:
|
||||
if fmt not in CONTAINER_NAMES:
|
||||
fmt = "mp3" # ultimate fallback
|
||||
|
||||
return {"format": fmt}
|
||||
|
||||
Reference in New Issue
Block a user