private Movie Convert(JSONMovie jsonMovie) { return(new Movie { TheMovieDbId = jsonMovie.theMovieDbId, Title = jsonMovie.title, Available = jsonMovie.available, Quality = jsonMovie.quality, Requested = jsonMovie.requested, PlexUrl = jsonMovie.plexUrl, EmbyUrl = jsonMovie.embyUrl, Overview = jsonMovie.overview, PosterPath = !string.IsNullOrWhiteSpace(jsonMovie.posterPath) ? $"https://image.tmdb.org/t/p/w500{jsonMovie.posterPath}" : null, ReleaseDate = jsonMovie.releaseDate, }); }
private Movie Convert(JSONMovie jsonMovie) { var isDownloaded = jsonMovie.downloaded.HasValue ? jsonMovie.downloaded.Value : jsonMovie.movieFile != null; var isMonitored = jsonMovie.monitored; return(new Movie { DownloadClientId = jsonMovie.id?.ToString(), Title = jsonMovie.title, Available = isDownloaded, Overview = jsonMovie.overview, TheMovieDbId = jsonMovie.tmdbId.ToString(), Quality = "", Requested = !isDownloaded && isMonitored, Approved = false, PlexUrl = "", EmbyUrl = "", PosterPath = jsonMovie.images.Where(x => x.coverType.Equals("poster", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault()?.url ?? string.Empty, ReleaseDate = jsonMovie.inCinemas, }); }
private Movie Convert(JSONMovie jsonMovie) { var isDownloaded = jsonMovie.downloaded.HasValue ? jsonMovie.downloaded.Value : jsonMovie.movieFile != null; var isMonitored = jsonMovie.monitored; var downloadClientId = jsonMovie.id?.ToString(); return(new Movie { DownloadClientId = downloadClientId, Title = jsonMovie.title, Available = isDownloaded, Overview = jsonMovie.overview, TheMovieDbId = jsonMovie.tmdbId.ToString(), Quality = "", Requested = !isDownloaded && (string.IsNullOrWhiteSpace(downloadClientId) || RadarrSettings.MonitorNewRequests) ? isMonitored : true, PlexUrl = "", EmbyUrl = "", PosterPath = GetPosterImageUrl(jsonMovie.images), ReleaseDate = jsonMovie.inCinemas, }); }