mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
using ErsatzTV.Core.Domain; |
|
|
|
namespace ErsatzTV.Application.Television |
|
{ |
|
internal static class Mapper |
|
{ |
|
internal static TelevisionShowViewModel ProjectToViewModel(TelevisionShow show) => |
|
new(show.Id, show.Metadata.Title, show.Metadata.Year?.ToString(), show.Metadata.Plot, show.Poster); |
|
|
|
internal static TelevisionSeasonViewModel ProjectToViewModel(TelevisionSeason season) => |
|
new( |
|
season.Id, |
|
season.TelevisionShowId, |
|
season.TelevisionShow.Metadata.Title, |
|
season.TelevisionShow.Metadata.Year?.ToString(), |
|
season.Number == 0 ? "Specials" : $"Season {season.Number}", |
|
season.Poster); |
|
|
|
internal static TelevisionEpisodeViewModel ProjectToViewModel(TelevisionEpisodeMediaItem episode) => |
|
new( |
|
episode.Season.TelevisionShowId, |
|
episode.SeasonId, |
|
episode.Metadata.Episode, |
|
episode.Metadata.Title, |
|
episode.Metadata.Plot, |
|
episode.Poster); |
|
} |
|
}
|
|
|