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

Method assign

apps/channels/api_views.py:1825–1840  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

1823 )
1824 @action(detail=False, methods=["post"], url_path="assign")
1825 def assign(self, request):
1826 with transaction.atomic():
1827 channel_ids = request.data.get("channel_ids", [])
1828 # Ensure starting_number is processed as a float
1829 try:
1830 channel_num = float(request.data.get("starting_number", 1))
1831 except (ValueError, TypeError):
1832 channel_num = 1.0
1833
1834 for channel_id in channel_ids:
1835 Channel.objects.filter(id=channel_id).update(channel_number=channel_num)
1836 channel_num = channel_num + 1
1837
1838 return Response(
1839 {"message": "Channels have been auto-assigned!"}, status=status.HTTP_200_OK
1840 )
1841
1842 @extend_schema(
1843 methods=["POST"],

Callers 13

EPG.test.jsxFile · 0.80
M3U.test.jsxFile · 0.80
M3UFilter.test.jsxFile · 0.80
Stream.test.jsxFile · 0.80
Recording.test.jsxFile · 0.80
makeFormMockFunction · 0.80
constructorMethod · 0.80

Calls 3

getMethod · 0.45
updateMethod · 0.45
filterMethod · 0.45

Tested by 2

makeFormMockFunction · 0.64
constructorMethod · 0.64