mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Backport #10173
This commit is contained in:
parent
757f88b1a2
commit
f8fd851961
@ -751,9 +751,11 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isAudio
|
if (isAudio
|
||||||
|| string.Equals(stream.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase)
|
&& (string.Equals(stream.Codec, "bmp", StringComparison.OrdinalIgnoreCase)
|
||||||
|| string.Equals(stream.Codec, "gif", StringComparison.OrdinalIgnoreCase)
|
|| string.Equals(stream.Codec, "gif", StringComparison.OrdinalIgnoreCase)
|
||||||
|| string.Equals(stream.Codec, "png", StringComparison.OrdinalIgnoreCase))
|
|| string.Equals(stream.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals(stream.Codec, "png", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals(stream.Codec, "webp", StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
stream.Type = MediaStreamType.EmbeddedImage;
|
stream.Type = MediaStreamType.EmbeddedImage;
|
||||||
}
|
}
|
||||||
|
@ -176,9 +176,11 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
|
|
||||||
var format = imageStream.Codec switch
|
var format = imageStream.Codec switch
|
||||||
{
|
{
|
||||||
|
"bmp" => ImageFormat.Bmp,
|
||||||
|
"gif" => ImageFormat.Gif,
|
||||||
"mjpeg" => ImageFormat.Jpg,
|
"mjpeg" => ImageFormat.Jpg,
|
||||||
"png" => ImageFormat.Png,
|
"png" => ImageFormat.Png,
|
||||||
"gif" => ImageFormat.Gif,
|
"webp" => ImageFormat.Webp,
|
||||||
_ => ImageFormat.Jpg
|
_ => ImageFormat.Jpg
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,9 +98,11 @@ namespace Jellyfin.Providers.Tests.MediaInfo
|
|||||||
[InlineData(null, null, 1, ImageType.Primary, ImageFormat.Jpg)] // no label, finds primary
|
[InlineData(null, null, 1, ImageType.Primary, ImageFormat.Jpg)] // no label, finds primary
|
||||||
[InlineData("backdrop", null, 2, ImageType.Backdrop, ImageFormat.Jpg)] // uses label to find index 2, not just pulling first stream
|
[InlineData("backdrop", null, 2, ImageType.Backdrop, ImageFormat.Jpg)] // uses label to find index 2, not just pulling first stream
|
||||||
[InlineData("cover", null, 2, ImageType.Primary, ImageFormat.Jpg)] // uses label to find index 2, not just pulling first stream
|
[InlineData("cover", null, 2, ImageType.Primary, ImageFormat.Jpg)] // uses label to find index 2, not just pulling first stream
|
||||||
|
[InlineData(null, "bmp", 1, ImageType.Primary, ImageFormat.Bmp)]
|
||||||
|
[InlineData(null, "gif", 1, ImageType.Primary, ImageFormat.Gif)]
|
||||||
[InlineData(null, "mjpeg", 1, ImageType.Primary, ImageFormat.Jpg)]
|
[InlineData(null, "mjpeg", 1, ImageType.Primary, ImageFormat.Jpg)]
|
||||||
[InlineData(null, "png", 1, ImageType.Primary, ImageFormat.Png)]
|
[InlineData(null, "png", 1, ImageType.Primary, ImageFormat.Png)]
|
||||||
[InlineData(null, "gif", 1, ImageType.Primary, ImageFormat.Gif)]
|
[InlineData(null, "webp", 1, ImageType.Primary, ImageFormat.Webp)]
|
||||||
public async void GetImage_Embedded_ReturnsCorrectSelection(string label, string? codec, int targetIndex, ImageType type, ImageFormat? expectedFormat)
|
public async void GetImage_Embedded_ReturnsCorrectSelection(string label, string? codec, int targetIndex, ImageType type, ImageFormat? expectedFormat)
|
||||||
{
|
{
|
||||||
var streams = new List<MediaStream>();
|
var streams = new List<MediaStream>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user