Skip to content

Commit

Permalink
fix(livetv): use MediaType instead of ToString and add text/ as disal…
Browse files Browse the repository at this point in the history
…lowed mimetypes
  • Loading branch information
cvium committed May 17, 2024
1 parent 26714e2 commit c647143
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class M3UTunerHost : BaseTunerHost, ITunerHost, IConfigurableTunerHost
{
private static readonly string[] _disallowedMimeTypes =
{
"text/plain",
"text/html",
"video/x-matroska",
"video/mp4",
"application/vnd.apple.mpegurl",
Expand Down Expand Up @@ -118,7 +120,7 @@ protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo tunerH

if (response.IsSuccessStatusCode)
{
if (!_disallowedMimeTypes.Contains(response.Content.Headers.ContentType?.ToString(), StringComparison.OrdinalIgnoreCase))
if (!_disallowedMimeTypes.Contains(response.Content.Headers.ContentType?.MediaType, StringComparison.OrdinalIgnoreCase))
{
return new SharedHttpStream(mediaSource, tunerHost, streamId, FileSystem, _httpClientFactory, Logger, Config, _appHost, _streamHelper);
}
Expand Down

0 comments on commit c647143

Please sign in to comment.