endoreg-db 0.8.2.4__py3-none-any.whl → 0.8.2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of endoreg-db might be problematic. Click here for more details.

@@ -1,40 +0,0 @@
1
- from endoreg_db.models import VideoFile
2
- from endoreg_db.utils.permissions import EnvironmentAwarePermission
3
-
4
-
5
- from django.shortcuts import get_object_or_404
6
- from rest_framework import status
7
- from rest_framework.response import Response
8
- from rest_framework.views import APIView
9
-
10
-
11
- class VideoReprocessView(APIView):
12
- """
13
- POST /api/video-reprocess/{id}/ - Reprocess video with updated settings
14
- """
15
- permission_classes = [EnvironmentAwarePermission]
16
-
17
- def post(self, request, pk):
18
- video = get_object_or_404(VideoFile, pk=pk)
19
-
20
- try:
21
- # Reset video processing status
22
- if hasattr(video, 'processing_status'):
23
- video.processing_status = 'not_started'
24
- video.save()
25
-
26
- # Start reprocessing task
27
- from endoreg_db.tasks.video_processing_tasks import reprocess_video_task
28
-
29
- task = reprocess_video_task.delay(video_id=pk)
30
-
31
- return Response(
32
- {"task_id": task.id, "status": "reprocessing_started"},
33
- status=status.HTTP_202_ACCEPTED
34
- )
35
-
36
- except Exception as e:
37
- return Response(
38
- {"error": f"Failed to start reprocessing: {str(e)}"},
39
- status=status.HTTP_500_INTERNAL_SERVER_ERROR
40
- )