MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / stop_channel

Function stop_channel

apps/proxy/live_proxy/views.py:853–876  ·  view source on GitHub ↗

Stop a channel and release all associated resources using PubSub events

(request, channel_id)

Source from the content-addressed store, hash-verified

851@api_view(["POST", "DELETE"])
852@permission_classes([IsAdmin])
853def stop_channel(request, channel_id):
854 """Stop a channel and release all associated resources using PubSub events"""
855 try:
856 logger.info(f"Request to stop channel {channel_id} received")
857
858 # Use the service layer instead of direct implementation
859 result = ChannelService.stop_channel(channel_id)
860
861 if result.get("status") == "error":
862 return JsonResponse(
863 {"error": result.get("message", "Unknown error")}, status=404
864 )
865
866 return JsonResponse(
867 {
868 "message": "Channel stop request sent",
869 "channel_id": channel_id,
870 "previous_state": result.get("previous_state"),
871 }
872 )
873
874 except Exception as e:
875 logger.error(f"Failed to stop channel: {e}", exc_info=True)
876 return JsonResponse({"error": str(e)}, status=500)
877
878
879@csrf_exempt

Callers

nothing calls this directly

Calls 2

stop_channelMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected