mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
Additional check if channel number is in use before creating.
This commit is contained in:
parent
6c1dbff91c
commit
a1d35a8dad
2 changed files with 2 additions and 7 deletions
|
|
@ -623,12 +623,7 @@ class ChannelViewSet(viewsets.ModelViewSet):
|
|||
)
|
||||
# If the provided number is already used, return an error.
|
||||
if Channel.objects.filter(channel_number=channel_number).exists():
|
||||
return Response(
|
||||
{
|
||||
"error": f"Channel number {channel_number} is already in use. Please choose a different number."
|
||||
},
|
||||
status=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
channel_number = Channel.get_next_available_channel_number(channel_number)
|
||||
# Get the tvc_guide_stationid from custom properties if it exists
|
||||
tvc_guide_stationid = None
|
||||
if "tvc-guide-stationid" in stream_custom_props:
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ export const WebsocketProvider = ({ children }) => {
|
|||
// General notification for channel creation
|
||||
notifications.show({
|
||||
title: 'Channels Created',
|
||||
message: `Successfully created ${parsedEvent.data.count || 'multiple'} channels`,
|
||||
message: `Successfully created ${parsedEvent.data.count || 'multiple'} channel(s)`,
|
||||
color: 'green',
|
||||
autoClose: 4000,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue