1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2025-04-29 04:31:05 +00:00

add downloadable lower thirds images to be used in voctomix

This commit is contained in:
Franzi 2024-11-03 13:46:47 +01:00
parent f459c6c498
commit c0b3bdb55e
Signed by: kunsi
GPG key ID: 12E3D2136B818350
11 changed files with 651 additions and 83 deletions

View file

@ -0,0 +1,22 @@
from django.http import FileResponse, Http404
from django.views import View
from pretalx.common.text.path import safe_filename
from pretalx.common.views.mixins import EventPermissionRequired
from pretalx_broadcast_tools.management.commands.export_voctomix_lower_thirds import (
get_export_targz_path,
)
class BroadcastToolsLowerThirdsVoctomixDownloadView(EventPermissionRequired, View):
permission_required = "agenda.view_schedule"
def get(self, request, *args, **kwargs):
targz_path = get_export_targz_path(self.request.event)
if not targz_path.exists():
raise Http404()
response = FileResponse(open(targz_path, "rb"), as_attachment=True)
response["Content-Disposition"] = (
f"attachment; filename={safe_filename(targz_path.name)}"
)
return response