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
517 B
18 lines
517 B
using ErsatzTV.Core.Domain; |
|
using static LanguageExt.Prelude; |
|
|
|
namespace ErsatzTV.Application.Movies |
|
{ |
|
internal static class Mapper |
|
{ |
|
internal static MovieViewModel ProjectToViewModel(Movie movie) |
|
{ |
|
MovieMetadata metadata = Optional(movie.MovieMetadata).Flatten().Head(); |
|
return new MovieViewModel( |
|
metadata.Title, |
|
metadata.ReleaseDate?.Year.ToString(), |
|
metadata.Plot, |
|
movie.Poster); |
|
} |
|
} |
|
}
|
|
|