From c647143e536732f1e6854e89ca3faa50113dc356 Mon Sep 17 00:00:00 2001 From: cvium Date: Fri, 17 May 2024 18:50:44 +0200 Subject: [PATCH] fix(livetv): use MediaType instead of ToString and add text/ as disallowed mimetypes --- src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs b/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs index 97090e442d..c1e1a7bda8 100644 --- a/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs +++ b/src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs @@ -32,6 +32,8 @@ namespace Jellyfin.LiveTv.TunerHosts { private static readonly string[] _disallowedMimeTypes = { + "text/plain", + "text/html", "video/x-matroska", "video/mp4", "application/vnd.apple.mpegurl", @@ -118,7 +120,7 @@ namespace Jellyfin.LiveTv.TunerHosts 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); }