mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Bug Fix: Fixes a bug with auto channel sync where channel numbers could be duplicated if multiple groups overlapped.
This commit is contained in:
parent
2c9f6d7360
commit
fb2f156fd8
1 changed files with 7 additions and 7 deletions
|
|
@ -1648,6 +1648,13 @@ def sync_auto_channels(account_id, scan_start_time=None):
|
|||
channels_updated = 0
|
||||
channels_deleted = 0
|
||||
|
||||
# Get all channel numbers that are already in use by other channels (not auto-created by this account)
|
||||
used_numbers = set(
|
||||
Channel.objects.exclude(
|
||||
auto_created=True, auto_created_by=account
|
||||
).values_list("channel_number", flat=True)
|
||||
)
|
||||
|
||||
for group_relation in auto_sync_groups:
|
||||
channel_group = group_relation.channel_group
|
||||
start_number = group_relation.auto_sync_channel_start or 1.0
|
||||
|
|
@ -1841,13 +1848,6 @@ def sync_auto_channels(account_id, scan_start_time=None):
|
|||
channels_to_renumber = []
|
||||
temp_channel_number = start_number
|
||||
|
||||
# Get all channel numbers that are already in use by other channels (not auto-created by this account)
|
||||
used_numbers = set(
|
||||
Channel.objects.exclude(
|
||||
auto_created=True, auto_created_by=account
|
||||
).values_list("channel_number", flat=True)
|
||||
)
|
||||
|
||||
for stream in current_streams:
|
||||
if stream.id in existing_channel_map:
|
||||
channel = existing_channel_map[stream.id]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue