This commit is contained in:
Markos Gogoulos
2026-03-09 19:58:14 +02:00
parent 182fb9599a
commit e130c7403c
2 changed files with 7 additions and 1 deletions

View File

@@ -1 +1 @@
VERSION = "8.0" VERSION = "8.12"

View File

@@ -35,6 +35,7 @@ from ..methods import (
) )
from ..models import ( from ..models import (
Category, Category,
Comment,
EncodeProfile, EncodeProfile,
Media, Media,
MediaPermission, MediaPermission,
@@ -302,6 +303,7 @@ class MediaBulkUserActions(APIView):
enum=[ enum=[
"enable_comments", "enable_comments",
"disable_comments", "disable_comments",
"delete_comments",
"delete_media", "delete_media",
"enable_download", "enable_download",
"disable_download", "disable_download",
@@ -386,6 +388,10 @@ class MediaBulkUserActions(APIView):
media.update(enable_comments=False) media.update(enable_comments=False)
return Response({"detail": f"Comments disabled for {media.count()} media items"}) return Response({"detail": f"Comments disabled for {media.count()} media items"})
elif action == "delete_comments":
deleted_count, _ = Comment.objects.filter(media__in=media).delete()
return Response({"detail": f"{deleted_count} comments deleted"})
elif action == "delete_media": elif action == "delete_media":
count = media.count() count = media.count()
media.delete() media.delete()