Add video support with unified media display.
All checks were successful
Docker / build (release) Successful in 9s

This commit is contained in:
krek0 2026-05-16 15:13:14 +02:00
parent a634cc88bd
commit f4052a3d99
16 changed files with 700 additions and 224 deletions

View file

@ -9,7 +9,7 @@ from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import FileResponse, Http404
from django.views.generic import ListView, View
from photologue.models import Gallery, Photo
from photologue.models import Gallery, Photo, Video
class MediaAccess(View):
@ -29,6 +29,12 @@ class MediaAccess(View):
image__startswith=original_dir + '/',
galleries__is_public=True,
).exists()
# Video files and their thumbnails
if not allowed:
allowed = (
Video.objects.filter(file=path, galleries__is_public=True).exists()
or Video.objects.filter(thumbnail=path, galleries__is_public=True).exists()
)
except Exception:
return redirect_to_login(request.get_full_path())
if not allowed: