Merge pull request #62 from Dispatcharr/dev

Dev
This commit is contained in:
SergeantPanda 2025-04-16 09:45:33 -05:00 committed by GitHub
commit 4341840e51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View file

@ -209,7 +209,19 @@ class ChannelSerializer(serializers.ModelSerializer):
# Handle streams if provided
if stream_ids is not None:
instance.streams.set(stream_ids)
# Clear existing associations
instance.channelstream_set.all().delete()
# Create new associations with proper ordering
for index, stream in enumerate(stream_ids):
# Extract the ID from the Stream object
actual_stream_id = stream.id if hasattr(stream, "id") else stream
print(f'Setting stream {actual_stream_id} to index {index}')
ChannelStream.objects.create(
channel=instance,
stream_id=actual_stream_id,
order=index
)
return instance

View file

@ -2,4 +2,4 @@
Dispatcharr version information.
"""
__version__ = '0.3.1' # Follow semantic versioning (MAJOR.MINOR.PATCH)
__build__ = '0' # Auto-incremented on builds
__build__ = '2' # Auto-incremented on builds