|
|
|
|
@ -9,17 +9,17 @@ namespace ErsatzTV.Application.Television
@@ -9,17 +9,17 @@ namespace ErsatzTV.Application.Television
|
|
|
|
|
internal static TelevisionShowViewModel ProjectToViewModel(Show show) => |
|
|
|
|
new( |
|
|
|
|
show.Id, |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(m => m.Title).IfNone(string.Empty), |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(m => m.Year?.ToString()).IfNone(string.Empty), |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(m => m.Plot).IfNone(string.Empty), |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(m => m.Title ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(m => m.Year?.ToString() ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(m => m.Plot ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
show.ShowMetadata.HeadOrNone().Map(GetPoster).IfNone(string.Empty)); |
|
|
|
|
|
|
|
|
|
internal static TelevisionSeasonViewModel ProjectToViewModel(Season season) => |
|
|
|
|
new( |
|
|
|
|
season.Id, |
|
|
|
|
season.ShowId, |
|
|
|
|
season.Show.ShowMetadata.HeadOrNone().Map(m => m.Title).IfNone(string.Empty), |
|
|
|
|
season.Show.ShowMetadata.HeadOrNone().Map(m => m.Year?.ToString()).IfNone(string.Empty), |
|
|
|
|
season.Show.ShowMetadata.HeadOrNone().Map(m => m.Title ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
season.Show.ShowMetadata.HeadOrNone().Map(m => m.Year?.ToString() ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
season.SeasonNumber == 0 ? "Specials" : $"Season {season.SeasonNumber}", |
|
|
|
|
season.SeasonMetadata.HeadOrNone().Map(GetPoster).IfNone(string.Empty)); |
|
|
|
|
|
|
|
|
|
@ -28,8 +28,8 @@ namespace ErsatzTV.Application.Television
@@ -28,8 +28,8 @@ namespace ErsatzTV.Application.Television
|
|
|
|
|
episode.Season.ShowId, |
|
|
|
|
episode.SeasonId, |
|
|
|
|
episode.EpisodeNumber, |
|
|
|
|
episode.EpisodeMetadata.HeadOrNone().Map(m => m.Title).IfNone(string.Empty), |
|
|
|
|
episode.EpisodeMetadata.HeadOrNone().Map(m => m.Plot).IfNone(string.Empty), |
|
|
|
|
episode.EpisodeMetadata.HeadOrNone().Map(m => m.Title ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
episode.EpisodeMetadata.HeadOrNone().Map(m => m.Plot ?? string.Empty).IfNone(string.Empty), |
|
|
|
|
episode.EpisodeMetadata.HeadOrNone().Map(GetThumbnail).IfNone(string.Empty)); |
|
|
|
|
|
|
|
|
|
private static string GetPoster(Metadata metadata) => |
|
|
|
|
|