Bug fix: When using direct urls in m3u output, use the correct stream based on the order for the channel.

Fixes #528
This commit is contained in:
SergeantPanda 2025-10-06 18:18:05 -05:00
parent e01338f055
commit 144a861142

View file

@ -166,7 +166,7 @@ def generate_m3u(request, profile_name=None, user=None):
# Determine the stream URL based on the direct parameter
if use_direct_urls:
# Try to get the first stream's direct URL
first_stream = channel.streams.first()
first_stream = channel.streams.order_by('channelstream__order').first()
if first_stream and first_stream.url:
# Use the direct stream URL
stream_url = first_stream.url