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.
18 lines
637 B
18 lines
637 B
using ErsatzTV.Core.Domain; |
|
|
|
namespace ErsatzTV.Application.Movies |
|
{ |
|
internal static class Mapper |
|
{ |
|
internal static MovieViewModel ProjectToViewModel(Movie movie) |
|
{ |
|
string title = movie.MovieMetadata.HeadOrNone().Map(m => m.Title).IfNone(string.Empty); |
|
string year = movie.MovieMetadata.HeadOrNone() |
|
.Map(m => m.ReleaseDate?.Year.ToString()) |
|
.IfNone(string.Empty); |
|
string plot = movie.MovieMetadata.HeadOrNone().Map(m => m.Plot).IfNone(string.Empty); |
|
|
|
return new MovieViewModel(title, year, plot, movie.Poster); |
|
} |
|
} |
|
}
|
|
|