From 49d56c653a0e1f5118be03e8939fba18a95a4797 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Sun, 7 Mar 2021 20:32:02 -0600 Subject: [PATCH] add m3u codec hints for channels app --- ErsatzTV.Core/Iptv/ChannelPlaylist.cs | 5 ++++- .../Data/Repositories/ChannelRepository.cs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ErsatzTV.Core/Iptv/ChannelPlaylist.cs b/ErsatzTV.Core/Iptv/ChannelPlaylist.cs index de6ac6361..7225184b6 100644 --- a/ErsatzTV.Core/Iptv/ChannelPlaylist.cs +++ b/ErsatzTV.Core/Iptv/ChannelPlaylist.cs @@ -45,8 +45,11 @@ namespace ErsatzTV.Core.Iptv _ => "ts" }; + string vcodec = channel.FFmpegProfile.VideoCodec.Split("_").Head(); + string acodec = channel.FFmpegProfile.AudioCodec; + sb.AppendLine( - $"#EXTINF:0 tvg-id=\"{channel.Number}\" channel-id=\"{shortUniqueId}\" channel-number=\"{channel.Number}\" CUID=\"{shortUniqueId}\" tvg-chno=\"{channel.Number}\" tvg-name=\"{channel.Name}\" tvg-logo=\"{logo}\" group-title=\"ErsatzTV\", {channel.Name}"); + $"#EXTINF:0 tvg-id=\"{channel.Number}\" channel-id=\"{shortUniqueId}\" channel-number=\"{channel.Number}\" CUID=\"{shortUniqueId}\" tvg-chno=\"{channel.Number}\" tvg-name=\"{channel.Name}\" tvg-logo=\"{logo}\" group-title=\"ErsatzTV\" tvc-stream-vcodec=\"{vcodec}\" tvc-stream-acodec=\"{acodec}\", {channel.Name}"); sb.AppendLine($"{_scheme}://{_host}/iptv/channel/{channel.Number}.{format}"); } diff --git a/ErsatzTV.Infrastructure/Data/Repositories/ChannelRepository.cs b/ErsatzTV.Infrastructure/Data/Repositories/ChannelRepository.cs index 00c8b727c..6eb7a8675 100644 --- a/ErsatzTV.Infrastructure/Data/Repositories/ChannelRepository.cs +++ b/ErsatzTV.Infrastructure/Data/Repositories/ChannelRepository.cs @@ -39,6 +39,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories public Task> GetAll() => _dbContext.Channels + .Include(c => c.FFmpegProfile) .Include(c => c.Artwork) .ToListAsync();