fix(channels): honor stream profile override in Channel.get_stream_profile()

Channel.get_stream_profile() read self.stream_profile directly, bypassing
the override system. The override-aware property effective_stream_profile_obj
already existed and called _resolve_effective_fk('stream_profile') which
correctly picks override.stream_profile when set, but nothing in the
streaming path called it.

As a result, a per-channel 'Stream Profile' override saved through the UI
was visible in the channel edit form (yellow pencil indicator appeared) but
silently ignored at stream time — Dispatcharr always used the global default
profile regardless of what was configured per-channel.

Fix: call effective_stream_profile_obj in get_stream_profile() so that all
callers (live proxy url_utils, input manager, views) automatically pick up
channel-level overrides without any further changes.

Fixes #1268

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nemesbak 2026-05-28 13:39:05 +02:00
parent 5ea194059b
commit 5eb118478b

View file

@ -451,9 +451,11 @@ class Channel(models.Model):
def effective_stream_profile_obj(self):
return self._resolve_effective_fk("stream_profile")
# @TODO: honor stream's stream profile
def get_stream_profile(self):
stream_profile = self.stream_profile
# Respect per-channel overrides: effective_stream_profile_obj uses
# _resolve_effective_fk which picks override.stream_profile when set,
# falling back to the channel's own stream_profile field.
stream_profile = self.effective_stream_profile_obj
if not stream_profile:
stream_profile = StreamProfile.objects.get(
id=CoreSettings.get_default_stream_profile_id()