1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 02:09:59 +00:00

Available date is now displayed.

This commit is contained in:
Leonardo Galli 2017-01-08 16:36:22 +01:00
parent 55f4a81dee
commit fb7969e046
3 changed files with 20 additions and 2 deletions

View file

@ -107,11 +107,21 @@ public Movie GetMovieInfo(int TmdbId)
foreach(ReleaseDate releaseDate in releaseDates.release_dates) foreach(ReleaseDate releaseDate in releaseDates.release_dates)
{ {
if (releaseDate.type == 5 || releaseDate.type == 4) if (releaseDate.type == 5 || releaseDate.type == 4)
{
if (movie.PhysicalRelease.HasValue)
{
if (movie.PhysicalRelease.Value.After(DateTime.Parse(releaseDate.release_date)))
{
movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); //Use oldest release date available.
}
}
else
{ {
movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date);
} }
} }
} }
}
movie.Ratings = new Ratings(); movie.Ratings = new Ratings();
movie.Ratings.Votes = resource.vote_count; movie.Ratings.Votes = resource.vote_count;

View file

@ -83,6 +83,7 @@ private void RefreshMovieInfo(Movie movie)
movie.Website = movieInfo.Website; movie.Website = movieInfo.Website;
movie.AlternativeTitles = movieInfo.AlternativeTitles; movie.AlternativeTitles = movieInfo.AlternativeTitles;
movie.Year = movieInfo.Year; movie.Year = movieInfo.Year;
movie.PhysicalRelease = movieInfo.PhysicalRelease;
try try
{ {

View file

@ -134,10 +134,17 @@ Handlebars.registerHelper('inCinemas', function() {
var monthNames = ["January", "February", "March", "April", "May", "June", var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" "July", "August", "September", "October", "November", "December"
]; ];
if (this.physicalRelease) {
var d = new Date(this.physicalRelease);
var day = d.getDate();
var month = monthNames[d.getMonth()];
var year = d.getFullYear();
return "Available: " + day + ". " + month + " " + year;
}
var cinemasDate = new Date(this.inCinemas); var cinemasDate = new Date(this.inCinemas);
var year = cinemasDate.getFullYear(); var year = cinemasDate.getFullYear();
var month = monthNames[cinemasDate.getMonth()]; var month = monthNames[cinemasDate.getMonth()];
return "In Cinemas " + month + " " + year; return "In Cinemas: " + month + " " + year;
}); });
Handlebars.registerHelper('tvRageUrl', function() { Handlebars.registerHelper('tvRageUrl', function() {