Files
ersatztv/ErsatzTV.Core/Domain/MediaItem/BackgroundImageMediaVersion.cs
T
Jason DoveandGitHub 7e30444857 dependencies and code cleanup (#2117)
* fix validation in new form layout

* pin mediatr to last oss version

* update dependencies

* cleanup code in core

* cleanup code in ffmpeg

* cleanup code in infra

* cleanup code in scanner

* cleanup code in application

* cleanup main code

* cleanup test code

* solution-wide code cleanup
2025-07-06 15:56:17 +00:00

35 lines
1.1 KiB
C#

using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.Core.Domain;
public class BackgroundImageMediaVersion : MediaVersion
{
public bool IsSongWithProgress { get; private set; }
public static BackgroundImageMediaVersion ForPath(
string path,
IDisplaySize resolution,
bool isSongWithProgress = false) =>
new()
{
Chapters = [],
// image has been pre-generated with correct size
Height = resolution.Height,
Width = resolution.Width,
SampleAspectRatio = "1:1",
Streams =
[
new MediaStream
{
MediaStreamKind = MediaStreamKind.Video,
Index = 0,
Codec = VideoFormat.GeneratedImage,
PixelFormat = new PixelFormatUnknown().Name // the resulting pixel format is unknown
}
],
MediaFiles = [new MediaFile { Path = path }],
IsSongWithProgress = isSongWithProgress
};
}