@ -1,10 +1,10 @@
using System ;
using System.Collections.Generic ;
using System.Linq ;
using Radarr.Http.REST ;
using NzbDrone.Api.MovieFiles ;
using NzbDrone.Core.MediaCover ;
using NzbDrone.Core.Movies ;
using NzbDrone.Api.MovieFiles ;
using Radarr.Http.REST ;
namespace NzbDrone.Api.Movies
{
@ -64,6 +64,7 @@ namespace NzbDrone.Api.Movies
public DateTime Added { get ; set ; }
public AddMovieOptions AddOptions { get ; set ; }
public Ratings Ratings { get ; set ; }
//public List<string> AlternativeTitles { get; set; }
public MovieFileResource MovieFile { get ; set ; }
@ -90,15 +91,15 @@ namespace NzbDrone.Api.Movies
{
public static MovieResource ToResource ( this Core . Movies . Movie model )
{
if ( model = = null ) return null ;
if ( model = = null )
{
return null ;
}
long size = model . MovieFile ? . Size ? ? 0 ;
bool downloaded = model . MovieFile ! = null ;
MovieFileResource movieFile = model . MovieFile ? . ToResource ( ) ;
/ * if ( model . MovieFile ! = null )
{
model . MovieFile . LazyLoad ( ) ;
@ -112,12 +113,12 @@ namespace NzbDrone.Api.Movies
} * /
//model.AlternativeTitles.LazyLoad();
return new MovieResource
{
Id = model . Id ,
TmdbId = model . TmdbId ,
Title = model . Title ,
//AlternateTitles
SortTitle = model . SortTitle ,
InCinemas = model . InCinemas ,
@ -125,12 +126,14 @@ namespace NzbDrone.Api.Movies
PhysicalReleaseNote = model . PhysicalReleaseNote ,
HasFile = model . HasFile ,
Downloaded = downloaded ,
//TotalEpisodeCount
//EpisodeCount
//EpisodeFileCount
SizeOnDisk = size ,
Status = model . Status ,
Overview = model . Overview ,
//NextAiring
//PreviousAiring
Images = model . Images ,
@ -150,7 +153,6 @@ namespace NzbDrone.Api.Movies
FolderName = model . FolderName ( ) ,
//SizeOnDisk = size,
Runtime = model . Runtime ,
LastInfoSync = model . LastInfoSync ,
CleanTitle = model . CleanTitle ,
@ -173,7 +175,10 @@ namespace NzbDrone.Api.Movies
public static Core . Movies . Movie ToModel ( this MovieResource resource )
{
if ( resource = = null ) return null ;
if ( resource = = null )
{
return null ;
}
return new Core . Movies . Movie
{
@ -181,16 +186,19 @@ namespace NzbDrone.Api.Movies
TmdbId = resource . TmdbId ,
Title = resource . Title ,
//AlternateTitles
SortTitle = resource . SortTitle ,
InCinemas = resource . InCinemas ,
PhysicalRelease = resource . PhysicalRelease ,
PhysicalReleaseNote = resource . PhysicalReleaseNote ,
//TotalEpisodeCount
//EpisodeCount
//EpisodeFileCount
//SizeOnDisk
Overview = resource . Overview ,
//NextAiring
//PreviousAiring
Images = resource . Images ,
@ -218,6 +226,7 @@ namespace NzbDrone.Api.Movies
Tags = resource . Tags ,
Added = resource . Added ,
AddOptions = resource . AddOptions ,
//AlternativeTitles = resource.AlternativeTitles,
Ratings = resource . Ratings ,
YouTubeTrailerId = resource . YouTubeTrailerId ,