feat(media): library/* Speicherpfade nach Sichtbarkeit und Verein
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 7s
Test Suite / playwright-tests (push) Successful in 23s

- media_storage.library_storage_key + relocate_local_media_file
- Übungs- und Archiv-Upload nutzen library/private|club/c*|official
- PATCH/Bulk-Patch: bei visibility/club_id Datei umziehen, storage_key + exercise_media.file_path
- pytest: test_library_storage_key; Mocks angepasst
- version 0.8.52 / media_assets 1.7.0 / exercises 2.17.0

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-05-08 09:47:16 +02:00
1 parent b8842cf98e
commit 4fb77d6927
6 files changed
+227 -15

No files matched your search

+5 -2
View File
@@ -28,7 +28,7 @@ from club_tenancy import (
library_content_visible_to_profile,
)
from tenant_context import TenantContext, get_tenant_context, get_tenant_context_flexible, library_content_visibility_sql
from media_storage import get_effective_media_root, path_under_media_root
from media_storage import get_effective_media_root, library_storage_key, path_under_media_root
logger = logging.getLogger(__name__)
@@ -2490,7 +2490,10 @@ async def upload_exercise_media(
},
)
else:
storage_key = f"exercises/{full_sha}{ext}"
try:
storage_key = library_storage_key(ex_vis, ex_club, full_sha, ext)
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e)) from e
dest_path = path_under_media_root(media_root, storage_key)
if dest_path is None:
raise HTTPException(status_code=500, detail="Ungültiger Speicherpfad")