Browse Source

recordings merge test

master
Mohsen Taba 1 month ago
parent
commit
1cc971a68d
  1. 14
      apps/course/views/webhook.py

14
apps/course/views/webhook.py

@ -319,6 +319,18 @@ class PlugNMeetWebhookAPIView(APIView):
try: try:
session = CourseLiveSession.objects.get(room_id=room_id) session = CourseLiveSession.objects.get(room_id=room_id)
client = PlugNMeetClient() client = PlugNMeetClient()
recording_info_response = client.get_recording_info(recording_id)
recording_info_payload = (
recording_info_response.get('recordingInfo')
or recording_info_response.get('recording_info')
or {}
)
recording_metadata = recording_info_payload.get('metadata') or {}
extra_data = recording_metadata.get('extraData') or recording_metadata.get('extra_data') or {}
if extra_data.get('imamjavad_recording_kind') == 'segment':
logger.info(f"ℹ️ [PlugNMeet Webhook] Ignoring partial recording segment: {recording_id}")
return {'message': 'Ignored partial recording segment'}
# 1. Fetch download token # 1. Fetch download token
token_response = client.get_recording_download_token(recording_id) token_response = client.get_recording_download_token(recording_id)
@ -385,4 +397,4 @@ class PlugNMeetWebhookAPIView(APIView):
return False return False
except Exception as e: except Exception as e:
logger.warning(f"⚠️ [PlugNMeet Webhook] Thumbnail failed: {e}") logger.warning(f"⚠️ [PlugNMeet Webhook] Thumbnail failed: {e}")
return False
return False
Loading…
Cancel
Save