Simple web backend added with upload/status/process/download API
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"""Input validation utilities."""
|
||||
|
||||
import re
|
||||
from typing import List, Tuple
|
||||
|
||||
from ..models.request import TracklistEntry
|
||||
|
||||
|
||||
def validate_tracklist(tracklist: List[TracklistEntry]) -> Tuple[bool, List[str]]:
|
||||
"""
|
||||
Validate a tracklist and return any errors.
|
||||
|
||||
Returns:
|
||||
(is_valid, error_messages)
|
||||
"""
|
||||
errors = []
|
||||
for idx, entry in enumerate(tracklist, 1):
|
||||
# Each entry must have a timestamp
|
||||
if not entry.ts or not entry.ts.strip():
|
||||
errors.append(f"Line {idx}: Missing timestamp (%ts)")
|
||||
# Additional validation could be added here
|
||||
|
||||
return len(errors) == 0, errors
|
||||
Reference in New Issue
Block a user