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.
34 lines
1.2 KiB
34 lines
1.2 KiB
using ErsatzTV.Core.Domain; |
|
|
|
namespace ErsatzTV.Application.MediaCards |
|
{ |
|
internal static class Mapper |
|
{ |
|
internal static TelevisionShowCardViewModel ProjectToViewModel(TelevisionShow televisionShow) => |
|
new( |
|
televisionShow.Id, |
|
televisionShow.Metadata.Title, |
|
televisionShow.Metadata.Year.ToString(), |
|
televisionShow.Metadata.SortTitle, |
|
televisionShow.Poster); |
|
|
|
internal static TelevisionSeasonCardViewModel ProjectToViewModel(TelevisionSeason televisionSeason) => |
|
new( |
|
televisionSeason.Id, |
|
GetSeasonName(televisionSeason.Number), |
|
string.Empty, |
|
GetSeasonName(televisionSeason.Number), |
|
televisionSeason.Poster); |
|
|
|
internal static MovieCardViewModel ProjectToViewModel(MovieMediaItem movie) => |
|
new( |
|
movie.Id, |
|
movie.Metadata.Title, |
|
movie.Metadata.Year.ToString(), |
|
movie.Metadata.SortTitle, |
|
movie.Poster); |
|
|
|
private static string GetSeasonName(int number) => |
|
number == 0 ? "Specials" : $"Season {number}"; |
|
} |
|
}
|
|
|