95c1f9b105
- Theme Context ausgelagert (ThemeContext.tsx + useDarkMode.ts) - Config Validation mit TMDB-API-Key Pflicht (config_validation.py) - Cache Key Centralization (cache/keys.py) - CD-Ripping mit abcde implementiert (Worker) - Docker Compose mit Healthchecks & LOG_LEVEL - ROADMAP.md & SAVEPOINT.md aktualisiert
26 lines
792 B
Python
26 lines
792 B
Python
import os
|
|
from celery_app import celery_app
|
|
from ripping import rip_dvd, rip_bluray, rip_cd, detect_disc_type
|
|
|
|
|
|
@celery_app.task(bind=True, name="worker.tasks.rip_disc")
|
|
def rip_disc(self, device_path: str, disc_id: str = None):
|
|
"""Rippt eine Disc basierend auf ihrem Typ."""
|
|
disc_type = detect_disc_type(device_path)
|
|
|
|
if not disc_id:
|
|
disc_id = device_path.replace("/", "_")
|
|
|
|
if disc_type == "cd":
|
|
return rip_cd(device_path, disc_id)
|
|
elif disc_type == "dvd":
|
|
return rip_dvd(device_path, disc_id)
|
|
elif disc_type == "bluray":
|
|
return rip_bluray(device_path, disc_id)
|
|
else:
|
|
return {
|
|
"status": "error",
|
|
"message": f"Unbekannter Disc-Typ: {disc_type}",
|
|
"disc_type": disc_type
|
|
}
|