1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Discovery of upcoming movies points to our server now.

Discovery results now show physical release date (if present).
All physical release dates now should show a note (if available) detailing what kind of release date it is (e.g. Netflix, DVD, Streaming, etc.)
This commit is contained in:
Leonardo Galli 2017-05-20 14:31:38 +02:00
parent 390e4c3014
commit 9dee1d6fad
8 changed files with 45 additions and 8 deletions

View File

@ -28,6 +28,7 @@ public MovieResource()
public string Overview { get; set; }
public DateTime? InCinemas { get; set; }
public DateTime? PhysicalRelease { get; set; }
public string PhysicalReleaseNote { get; set; }
public List<MediaCover> Images { get; set; }
public string Website { get; set; }
public bool Downloaded { get; set; }
@ -116,6 +117,7 @@ public static MovieResource ToResource(this Core.Tv.Movie model)
SortTitle = model.SortTitle,
InCinemas = model.InCinemas,
PhysicalRelease = model.PhysicalRelease,
PhysicalReleaseNote = model.PhysicalReleaseNote,
HasFile = model.HasFile,
Downloaded = downloaded,
//TotalEpisodeCount
@ -176,6 +178,7 @@ public static Core.Tv.Movie ToModel(this MovieResource resource)
SortTitle = resource.SortTitle,
InCinemas = resource.InCinemas,
PhysicalRelease = resource.PhysicalRelease,
PhysicalReleaseNote = resource.PhysicalReleaseNote,
//TotalEpisodeCount
//EpisodeCount
//EpisodeFileCount

View File

@ -0,0 +1,16 @@
using System.Data;
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(138)]
public class add_physical_release_note : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("Movies").AddColumn("PhysicalReleaseNote").AsString().Nullable();
}
}
}

View File

@ -36,6 +36,8 @@ public class MovieResult
public float vote_average { get; set; }
public string trailer_key { get; set; }
public string trailer_site { get; set; }
public string physical_release { get; set; }
public string physical_release_note { get; set; }
}

View File

@ -191,11 +191,13 @@ public Movie GetMovieInfo(int TmdbId, Profile profile = null, bool hasPreDBEntry
if (movie.PhysicalRelease.Value.After(DateTime.Parse(releaseDate.release_date)))
{
movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); //Use oldest release date available.
movie.PhysicalReleaseNote = releaseDate.note;
}
}
else
{
movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date);
movie.PhysicalReleaseNote = releaseDate.note;
}
}
}
@ -363,7 +365,7 @@ public List<Movie> DiscoverNewMovies(string action)
HttpRequest request;
List<MovieResult> results;
if (action == "upcoming")
/*if (action == "upcoming")
{
var lastWeek = DateTime.Now.AddDays(-7);
var threeWeeks = DateTime.Now.AddDays(7 * 3);
@ -388,7 +390,7 @@ public List<Movie> DiscoverNewMovies(string action)
results = response.Resource.results.ToList();
}
else
{
{*/
request = new HttpRequestBuilder("https://radarr.video/api/{action}/").SetSegment("action", action).Build();
request.AllowAutoRedirect = true;
@ -404,7 +406,7 @@ public List<Movie> DiscoverNewMovies(string action)
}
results = response.Resource;
}
//}
results = results.Where(m => allMovies.None(mo => mo.TmdbId == m.id) && allExclusions.None(ex => ex.TmdbId == m.id)).ToList();
@ -577,7 +579,17 @@ private Movie MapMovie(MovieResult result)
imdbMovie.Year = imdbMovie.InCinemas.Value.Year;
}
var now = DateTime.Now;
if (result.physical_release.IsNotNullOrWhiteSpace())
{
imdbMovie.PhysicalRelease = DateTime.Parse(result.physical_release);
if (result.physical_release_note.IsNotNullOrWhiteSpace())
{
imdbMovie.PhysicalReleaseNote = result.physical_release_note;
}
}
var now = DateTime.Now;
//handle the case when we have both theatrical and physical release dates
if (imdbMovie.InCinemas.HasValue && imdbMovie.PhysicalRelease.HasValue)
{

View File

@ -1284,6 +1284,7 @@
<Compile Include="NetImport\ImportExclusions\ImportExclusion.cs" />
<Compile Include="NetImport\ImportExclusions\ImportExclusionsRepository.cs" />
<Compile Include="NetImport\ImportExclusions\ImportExclusionsService.cs" />
<Compile Include="Datastore\Migration\138_add_physical_release_note.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">

View File

@ -45,6 +45,7 @@ public Movie()
public DateTime Added { get; set; }
public DateTime? InCinemas { get; set; }
public DateTime? PhysicalRelease { get; set; }
public String PhysicalReleaseNote { get; set; }
public LazyLoaded<Profile> Profile { get; set; }
public HashSet<int> Tags { get; set; }
public AddMovieOptions AddOptions { get; set; }

View File

@ -29,9 +29,11 @@
<span class="label label-default" title="{{ratings.votes}} Vote(s)">{{ratings.value}}</span>
{{#if youTubeTrailerId}}
<span class="label label-info">
<a href="{{youTubeTrailerUrl}}" style="color: white;">Trailer</a>
</span>
<span class="label label-info"><a href="{{youTubeTrailerUrl}}" style="color: white;">Trailer</a></span>
{{/if}}
{{#if physicalRelease}}
<span class="label label-info" title="{{physicalReleaseNote}}">{{inCinemas}}</span>
{{/if}}
</span>

View File

@ -20,7 +20,7 @@
{{#if_eq status compare="announced"}}
<span class="label label-default">{{inCinemas}}</span>
{{else}}
<span class="label label-info">{{inCinemas}}</span>
<span class="label label-info" title="{{physicalReleaseNote}}">{{inCinemas}}</span>
{{/if_eq}}
<span class="label label-{{DownloadedStatusColor}}" title="{{DownloadedQuality}}">{{DownloadedStatus}}</span>
</div>