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:
parent
f459c6c498
commit
c0b3bdb55e
11 changed files with 651 additions and 83 deletions
22
pretalx_broadcast_tools/views/voctomix_export.py
Normal file
22
pretalx_broadcast_tools/views/voctomix_export.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue