Files
ersatztv/ErsatzTV/ViewModels/ChannelEditViewModel.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

92 lines
3.0 KiB
C#

using ErsatzTV.Application.Artworks;
using ErsatzTV.Application.Channels;
using ErsatzTV.Core.Domain;
namespace ErsatzTV.ViewModels;
public class ChannelEditViewModel
{
private string _musicVideoCreditsTemplate;
public int Id { get; set; }
public string Name { get; set; }
public string Group { get; set; }
public string Categories { get; set; }
public string Number { get; set; }
public int FFmpegProfileId { get; set; }
public ChannelStreamSelectorMode StreamSelectorMode { get; set; }
public string StreamSelector { get; set; }
public string PreferredAudioLanguageCode { get; set; }
public string PreferredAudioTitle { get; set; }
public ArtworkContentTypeModel Logo { get; set; }
public string ExternalLogoUrl { get; set; }
public ChannelProgressMode ProgressMode { get; set; }
public StreamingMode StreamingMode { get; set; }
public int? WatermarkId { get; set; }
public int? FallbackFillerId { get; set; }
public string PreferredSubtitleLanguageCode { get; set; }
public ChannelSubtitleMode SubtitleMode { get; set; }
public ChannelMusicVideoCreditsMode MusicVideoCreditsMode { get; set; }
public string MusicVideoCreditsTemplate
{
get => MusicVideoCreditsMode == ChannelMusicVideoCreditsMode.GenerateSubtitles
? _musicVideoCreditsTemplate
: null;
set => _musicVideoCreditsTemplate = value;
}
public ChannelSongVideoMode SongVideoMode { get; set; }
public ChannelActiveMode ActiveMode { get; set; }
public UpdateChannel ToUpdate() =>
new(
Id,
Name,
Number,
Group,
Categories,
FFmpegProfileId,
string.IsNullOrWhiteSpace(ExternalLogoUrl)
? Logo
: new ArtworkContentTypeModel(ExternalLogoUrl, string.Empty),
StreamSelectorMode,
StreamSelector,
PreferredAudioLanguageCode,
PreferredAudioTitle,
ProgressMode,
StreamingMode,
WatermarkId,
FallbackFillerId,
PreferredSubtitleLanguageCode,
SubtitleMode,
MusicVideoCreditsMode,
MusicVideoCreditsTemplate,
SongVideoMode,
ActiveMode);
public CreateChannel ToCreate() =>
new(
Name,
Number,
Group,
Categories,
FFmpegProfileId,
string.IsNullOrWhiteSpace(ExternalLogoUrl)
? Logo
: new ArtworkContentTypeModel(ExternalLogoUrl, string.Empty),
StreamSelectorMode,
StreamSelector,
PreferredAudioLanguageCode,
PreferredAudioTitle,
ProgressMode,
StreamingMode,
WatermarkId,
FallbackFillerId,
PreferredSubtitleLanguageCode,
SubtitleMode,
MusicVideoCreditsMode,
MusicVideoCreditsTemplate,
SongVideoMode,
ActiveMode);
}