1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

Compare commits

..

27 Commits

Author SHA1 Message Date
Tim Turner
2bb21fedab Update height of posters to accomodate additional labels 2017-01-18 17:24:32 -05:00
vertigo235
91c820f98b Fix pushover priority values. 2017-01-18 23:16:57 +01:00
Leonardo Galli
7d3118aece Hopefully fix issue when importing
existing scene named movies
2017-01-18 23:02:05 +01:00
Tim Turner
4f4ad77ad1 Add download status to poster view
Fixes #319
2017-01-18 16:54:17 -05:00
Leonardo Galli
42f205a731 Update SkyHookProxy.cs 2017-01-18 22:50:12 +01:00
Devin Buhl
cbb2b778a6 Merge pull request #336 from Radarr/patch/add-imdb-to-naming
Add IMDb ID to file naming
2017-01-18 15:11:16 -05:00
Devin Buhl
b3e03a648d Add IMDb ID to file naming 2017-01-18 14:53:29 -05:00
Devin Buhl
acf45a79e8 Merge pull request #333 from baltoaca/develop
basic implementation of the wanted tab
2017-01-18 14:36:48 -05:00
Devin Buhl
b5d8ac852e Merge pull request #335 from Radarr/patch/task-updates
Turn off scene mapping task #329, update TaskManager to use 'DownloadedMovieScanCommand
2017-01-18 14:36:29 -05:00
Vlad Ilies
4aec0e8fc6 fixed build 2017-01-18 21:09:00 +02:00
Devin Buhl
ecea417fd8 Revert DownloadedMovieScanCommand to DownloadedEpisodesScanCommand
Not sure if it will break anything so putting it back.
2017-01-18 14:07:51 -05:00
Devin Buhl
6a41f6a435 Turn off scene mapping task #329, update TaskManager to use 'DownloadedMovieScanCommand' 2017-01-18 14:02:04 -05:00
Vlad Ilies
da2d075aa8 basic implementation of the wanted tab (#31)
* top buttons don't yet work

* new missing module for movies

*  find missing movies method to movie service

* new movie status cell with text

* adapted UI missing collection and layout
2017-01-18 20:53:17 +02:00
Devin Buhl
10dc3993df Merge pull request #332 from Radarr/revert-318-sonarr/sqlite-updates
Revert "Sonarr/sqlite updates"
2017-01-18 13:33:46 -05:00
Devin Buhl
7e5020db9a Merge pull request #331 from vertigo235/nzbgetaddpaused
Nzbgetaddpaused
2017-01-18 13:20:12 -05:00
Devin Buhl
c48fe9de12 Revert "Sonarr/sqlite updates" 2017-01-18 13:17:35 -05:00
vertigo235
421e827a95 Update Test Files for AddPaused to NZBGET 2017-01-18 13:08:59 -05:00
vertigo235
34d8045cf4 Add "Add Paused" option for NZBGET downloader
Adds option to pause nzbs uppon sending to NZBGET downloader.
2017-01-18 12:42:33 -05:00
Devin Buhl
c6de163748 Merge pull request #318 from Radarr/sonarr/sqlite-updates
Sonarr/sqlite updates
2017-01-17 18:59:11 -05:00
Keivan Beigi
d9e2b22e74 Upgraded System.Data.SQLite to 1.0.104.0 2017-01-17 18:45:23 -05:00
Keivan Beigi
65c0137964 Revert "Upgraded System.Data.SQLite to 1.0.104.0"
This reverts commit a6f3ac219d61964f1b923cfd89382f94c4c74243.
2017-01-17 18:44:37 -05:00
Keivan
ae19424ce7 New: Upgraded SQLite binares for macOS
Upgraded from 3.8.1 to 3.9.1
2017-01-17 18:41:11 -05:00
Keivan Beigi
7527ec52b7 New: Upgraded SQLite binaries for Windows (3.16.0) 2017-01-17 18:41:05 -05:00
Leonardo Galli
640fcf3eaf Remove series references 2017-01-17 23:57:04 +01:00
Leonardo Galli
3ce8232777 Hopefully fix download ordering. 2017-01-17 23:30:11 +01:00
Devin Buhl
864b441d8e Merge pull request #316 from Radarr/patch/skyhook-cleanup
Maybe this will solve the error Object reference not set to an instance of an object
2017-01-17 17:20:49 -05:00
Devin Buhl
bc2ff149b4 Maybe this will solve the error
Couldn't refresh info for [tt2032572][USS Indianapolis: Men of Courage]: Object reference not set to an instance of an object
2017-01-17 17:05:19 -05:00
24 changed files with 238 additions and 75 deletions

View File

@@ -260,6 +260,7 @@
<Compile Include="Wanted\CutoffModule.cs" /> <Compile Include="Wanted\CutoffModule.cs" />
<Compile Include="Wanted\LegacyMissingModule.cs" /> <Compile Include="Wanted\LegacyMissingModule.cs" />
<Compile Include="Wanted\MissingModule.cs" /> <Compile Include="Wanted\MissingModule.cs" />
<Compile Include="Wanted\MovieMissingModule.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
@@ -294,4 +295,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -12,7 +12,7 @@ namespace NzbDrone.Api.Wanted
ISeriesService seriesService, ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification, IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster) IBroadcastSignalRMessage signalRBroadcaster)
: base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/missing") : base(episodeService, seriesService, qualityUpgradableSpecification, signalRBroadcaster, "wanted/missing_episodes")
{ {
GetResourcePaged = GetMissingEpisodes; GetResourcePaged = GetMissingEpisodes;
} }

View File

@@ -0,0 +1,77 @@
using NzbDrone.Api.Movie;
using NzbDrone.Api.Movies;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Datastore;
using NzbDrone.SignalR;
using NzbDrone.Core.Download;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using System;
using NzbDrone.Core.Datastore.Events;
namespace NzbDrone.Api.Wanted
{
class MovieMissingModule : NzbDroneRestModuleWithSignalR<MovieResource, Core.Tv.Movie>,
IHandle<MovieGrabbedEvent>,
IHandle<MovieDownloadedEvent>
{
protected readonly IMovieService _movieService;
public MovieMissingModule(IMovieService movieService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
IBroadcastSignalRMessage signalRBroadcaster)
: base(signalRBroadcaster, "wanted/missing")
{
_movieService = movieService;
GetResourcePaged = GetMissingMovies;
}
private PagingResource<MovieResource> GetMissingMovies(PagingResource<MovieResource> pagingResource)
{
var pagingSpec = pagingResource.MapToPagingSpec<MovieResource, Core.Tv.Movie>("physicalRelease", SortDirection.Descending);
if (pagingResource.FilterKey == "monitored" && pagingResource.FilterValue == "false")
{
pagingSpec.FilterExpression = v => v.Monitored == false;
}
else
{
pagingSpec.FilterExpression = v => v.Monitored == true;
}
var resource = ApplyToPage(_movieService.MoviesWithoutFiles, pagingSpec, v => MapToResource(v, false));
return resource;
}
private MovieResource GetMovie(int id)
{
var movie = _movieService.GetMovie(id);
var resource = MapToResource(movie, true);
return resource;
}
private MovieResource MapToResource(Core.Tv.Movie movie, bool includeMovieFile)
{
var resource = movie.ToResource();
return resource;
}
public void Handle(MovieGrabbedEvent message)
{
var resource = message.Movie.Movie.ToResource();
//add a grabbed field in MovieResource?
//resource.Grabbed = true;
BroadcastResourceChange(ModelAction.Updated, resource);
}
public void Handle(MovieDownloadedEvent message)
{
BroadcastResourceChange(ModelAction.Updated, message.Movie.Movie.Id);
}
}
}

View File

@@ -92,14 +92,14 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
protected void GivenFailedDownload() protected void GivenFailedDownload()
{ {
Mocker.GetMock<INzbgetProxy>() Mocker.GetMock<INzbgetProxy>()
.Setup(s => s.DownloadNzb(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>(), It.IsAny<NzbgetSettings>())) .Setup(s => s.DownloadNzb(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>(), It.IsAny<bool>(), It.IsAny<NzbgetSettings>()))
.Returns((string)null); .Returns((string)null);
} }
protected void GivenSuccessfulDownload() protected void GivenSuccessfulDownload()
{ {
Mocker.GetMock<INzbgetProxy>() Mocker.GetMock<INzbgetProxy>()
.Setup(s => s.DownloadNzb(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>(), It.IsAny<NzbgetSettings>())) .Setup(s => s.DownloadNzb(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>(), It.IsAny<bool>(), It.IsAny<NzbgetSettings>()))
.Returns(Guid.NewGuid().ToString().Replace("-", "")); .Returns(Guid.NewGuid().ToString().Replace("-", ""));
} }

View File

@@ -68,6 +68,17 @@ namespace NzbDrone.Core.DecisionEngine
private int CompareProtocol(DownloadDecision x, DownloadDecision y) private int CompareProtocol(DownloadDecision x, DownloadDecision y)
{ {
if (x.IsForMovie)
{
return CompareBy(x.RemoteMovie, y.RemoteMovie, remoteEpisode =>
{
var delayProfile = _delayProfileService.BestForTags(remoteEpisode.Movie.Tags);
var downloadProtocol = remoteEpisode.Release.DownloadProtocol;
return downloadProtocol == delayProfile.PreferredProtocol;
});
}
var result = CompareBy(x.RemoteEpisode, y.RemoteEpisode, remoteEpisode => var result = CompareBy(x.RemoteEpisode, y.RemoteEpisode, remoteEpisode =>
{ {
var delayProfile = _delayProfileService.BestForTags(remoteEpisode.Series.Tags); var delayProfile = _delayProfileService.BestForTags(remoteEpisode.Series.Tags);
@@ -75,15 +86,7 @@ namespace NzbDrone.Core.DecisionEngine
return downloadProtocol == delayProfile.PreferredProtocol; return downloadProtocol == delayProfile.PreferredProtocol;
}); });
if (x.IsForMovie)
{
result = CompareBy(x.RemoteMovie, y.RemoteMovie, remoteEpisode =>
{
var delayProfile = _delayProfileService.BestForTags(remoteEpisode.Movie.Tags);
var downloadProtocol = remoteEpisode.Release.DownloadProtocol;
return downloadProtocol == delayProfile.PreferredProtocol;
});
}
return result; return result;
} }
@@ -125,8 +128,8 @@ namespace NzbDrone.Core.DecisionEngine
private int CompareAgeIfUsenet(DownloadDecision x, DownloadDecision y) private int CompareAgeIfUsenet(DownloadDecision x, DownloadDecision y)
{ {
if (x.RemoteEpisode.Release.DownloadProtocol != DownloadProtocol.Usenet || if (x.RemoteMovie.Release.DownloadProtocol != DownloadProtocol.Usenet ||
y.RemoteEpisode.Release.DownloadProtocol != DownloadProtocol.Usenet) y.RemoteMovie.Release.DownloadProtocol != DownloadProtocol.Usenet)
{ {
return 0; return 0;
} }

View File

@@ -34,11 +34,11 @@ namespace NzbDrone.Core.DecisionEngine
public List<DownloadDecision> PrioritizeDecisionsForMovies(List<DownloadDecision> decisions) public List<DownloadDecision> PrioritizeDecisionsForMovies(List<DownloadDecision> decisions)
{ {
return decisions.Where(c => c.RemoteMovie.Movie != null) return decisions.Where(c => c.RemoteMovie.Movie != null)
/*.GroupBy(c => c.RemoteMovie.Movie.Id, (movieId, downloadDecisions) => .GroupBy(c => c.RemoteMovie.Movie.Id, (movieId, downloadDecisions) =>
{ {
return downloadDecisions.OrderByDescending(decision => decision, new DownloadDecisionComparer(_delayProfileService)); return downloadDecisions.OrderByDescending(decision => decision, new DownloadDecisionComparer(_delayProfileService));
}) })
.SelectMany(c => c)*/ .SelectMany(c => c)
.Union(decisions.Where(c => c.RemoteMovie.Movie == null)) .Union(decisions.Where(c => c.RemoteMovie.Movie == null))
.ToList(); .ToList();
} }

View File

@@ -32,9 +32,12 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents) protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents)
{ {
var category = Settings.TvCategory; var category = Settings.TvCategory;
var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority; var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority;
var response = _proxy.DownloadNzb(fileContents, filename, category, priority, Settings); var addpaused = Settings.AddPaused;
var response = _proxy.DownloadNzb(fileContents, filename, category, priority, addpaused, Settings);
if (response == null) if (response == null)
{ {
@@ -47,9 +50,12 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents) protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents)
{ {
var category = Settings.TvCategory; // TODO: Update this to MovieCategory? var category = Settings.TvCategory; // TODO: Update this to MovieCategory?
var priority = Settings.RecentTvPriority; var priority = Settings.RecentTvPriority;
var response = _proxy.DownloadNzb(fileContents, filename, category, priority, Settings); var addpaused = Settings.AddPaused;
var response = _proxy.DownloadNzb(fileContents, filename, category, priority, addpaused, Settings);
if(response == null) if(response == null)
{ {

View File

@@ -11,7 +11,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
{ {
public interface INzbgetProxy public interface INzbgetProxy
{ {
string DownloadNzb(byte[] nzbData, string title, string category, int priority, NzbgetSettings settings); string DownloadNzb(byte[] nzbData, string title, string category, int priority, bool addpaused, NzbgetSettings settings);
NzbgetGlobalStatus GetGlobalStatus(NzbgetSettings settings); NzbgetGlobalStatus GetGlobalStatus(NzbgetSettings settings);
List<NzbgetQueueItem> GetQueue(NzbgetSettings settings); List<NzbgetQueueItem> GetQueue(NzbgetSettings settings);
List<NzbgetHistoryItem> GetHistory(NzbgetSettings settings); List<NzbgetHistoryItem> GetHistory(NzbgetSettings settings);
@@ -45,12 +45,12 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
return version >= minimumVersion; return version >= minimumVersion;
} }
public string DownloadNzb(byte[] nzbData, string title, string category, int priority, NzbgetSettings settings) public string DownloadNzb(byte[] nzbData, string title, string category, int priority, bool addpaused, NzbgetSettings settings)
{ {
if (HasVersion(16, settings)) if (HasVersion(16, settings))
{ {
var droneId = Guid.NewGuid().ToString().Replace("-", ""); var droneId = Guid.NewGuid().ToString().Replace("-", "");
var response = ProcessRequest<int>(settings, "append", title, nzbData, category, priority, false, false, string.Empty, 0, "all", new string[] { "drone", droneId }); var response = ProcessRequest<int>(settings, "append", title, nzbData, category, priority, false, addpaused, string.Empty, 0, "all", new string[] { "drone", droneId });
if (response <= 0) if (response <= 0)
{ {
return null; return null;

View File

@@ -57,6 +57,9 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
[FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)] [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)]
public bool UseSsl { get; set; } public bool UseSsl { get; set; }
[FieldDefinition(8, Label = "Add Paused", Type = FieldType.Checkbox)]
public bool AddPaused { get; set; }
public NzbDroneValidationResult Validate() public NzbDroneValidationResult Validate()
{ {
return new NzbDroneValidationResult(Validator.Validate(this)); return new NzbDroneValidationResult(Validator.Validate(this));

View File

@@ -64,7 +64,7 @@ namespace NzbDrone.Core.Jobs
new ScheduledTask{ Interval = 0.25f, TypeName = typeof(CheckForFinishedDownloadCommand).FullName}, new ScheduledTask{ Interval = 0.25f, TypeName = typeof(CheckForFinishedDownloadCommand).FullName},
new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName}, new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName},
new ScheduledTask{ Interval = 6*60, TypeName = typeof(ApplicationUpdateCommand).FullName}, new ScheduledTask{ Interval = 6*60, TypeName = typeof(ApplicationUpdateCommand).FullName},
new ScheduledTask{ Interval = 3*60, TypeName = typeof(UpdateSceneMappingCommand).FullName}, // new ScheduledTask{ Interval = 3*60, TypeName = typeof(UpdateSceneMappingCommand).FullName},
new ScheduledTask{ Interval = 6*60, TypeName = typeof(CheckHealthCommand).FullName}, new ScheduledTask{ Interval = 6*60, TypeName = typeof(CheckHealthCommand).FullName},
new ScheduledTask{ Interval = 24*60, TypeName = typeof(RefreshMovieCommand).FullName}, new ScheduledTask{ Interval = 24*60, TypeName = typeof(RefreshMovieCommand).FullName},
new ScheduledTask{ Interval = 24*60, TypeName = typeof(HousekeepingCommand).FullName}, new ScheduledTask{ Interval = 24*60, TypeName = typeof(HousekeepingCommand).FullName},
@@ -80,6 +80,7 @@ namespace NzbDrone.Core.Jobs
{ {
Interval = _configService.DownloadedEpisodesScanInterval, Interval = _configService.DownloadedEpisodesScanInterval,
TypeName = typeof(DownloadedEpisodesScanCommand).FullName TypeName = typeof(DownloadedEpisodesScanCommand).FullName
//TypeName = typeof(DownloadedMovieScanCommand).FullName
}, },
}; };

View File

@@ -152,19 +152,25 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
if (resource.videos != null) if (resource.videos != null)
{ {
foreach(Video video in resource.videos.results) foreach (Video video in resource.videos.results)
{ {
if(video.type == "Trailer" && video.site == "YouTube") if (video.type == "Trailer" && video.site == "YouTube")
{ {
movie.YouTubeTrailerId = video.key; if (video.key != null)
break; {
movie.YouTubeTrailerId = video.key;
break;
}
} }
} }
} }
if (resource.production_companies != null && resource.production_companies.Count() > 0) if (resource.production_companies != null)
{ {
movie.Studio = resource.production_companies[0].name; if (resource.production_companies.Any())
{
movie.Studio = resource.production_companies[0].name;
}
} }
return movie; return movie;
@@ -205,14 +211,14 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
lowerTitle = lowerTitle.Replace(".", ""); lowerTitle = lowerTitle.Replace(".", "");
var parserResult = Parser.Parser.ParseMovieTitle(title.Replace(".", ""), true); var parserResult = Parser.Parser.ParseMovieTitle(title, true);
var yearTerm = ""; var yearTerm = "";
if (parserResult != null && parserResult.MovieTitle != title) if (parserResult != null && parserResult.MovieTitle != title)
{ {
//Parser found something interesting! //Parser found something interesting!
lowerTitle = parserResult.MovieTitle.ToLower(); lowerTitle = parserResult.MovieTitle.ToLower().Replace(".", " "); //TODO Update so not every period gets replaced (e.g. R.I.P.D.)
if (parserResult.Year > 1800) if (parserResult.Year > 1800)
{ {
yearTerm = parserResult.Year.ToString(); yearTerm = parserResult.Year.ToString();
@@ -345,25 +351,19 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
{ {
imdbMovie.SortTitle = Parser.Parser.NormalizeTitle(result.title); imdbMovie.SortTitle = Parser.Parser.NormalizeTitle(result.title);
imdbMovie.Title = result.title; imdbMovie.Title = result.title;
string titleSlug = ToUrlSlug(result.title); imdbMovie.TitleSlug = ToUrlSlug(result.title);
imdbMovie.TitleSlug = titleSlug.ToLower().Replace(" ", "-");
if (result.release_date.IsNotNullOrWhiteSpace()) if (result.release_date.IsNotNullOrWhiteSpace())
{ {
imdbMovie.Year = DateTime.Parse(result.release_date).Year; imdbMovie.Year = DateTime.Parse(result.release_date).Year;
} }
//var slugResult = _movieService.FindByTitleSlug(imdbMovie.TitleSlug);
//if (slugResult != null) imdbMovie.TitleSlug += "-" + imdbMovie.Year;
//{
// _logger.Debug("Movie with this title slug already exists. Adding year...");
//}
imdbMovie.TitleSlug += "-" + imdbMovie.Year.ToString();
imdbMovie.Images = new List<MediaCover.MediaCover>(); imdbMovie.Images = new List<MediaCover.MediaCover>();
imdbMovie.Overview = result.overview; imdbMovie.Overview = result.overview;
try try
{ {
string url = result.poster_path;
var imdbPoster = _configService.GetCoverForURL(result.poster_path, MediaCoverTypes.Poster); var imdbPoster = _configService.GetCoverForURL(result.poster_path, MediaCoverTypes.Poster);
imdbMovie.Images.Add(imdbPoster); imdbMovie.Images.Add(imdbPoster);
} }

View File

@@ -2,7 +2,7 @@
{ {
public enum PushoverPriority public enum PushoverPriority
{ {
Silent = -1, Silent = -2,
Quiet = -1, Quiet = -1,
Normal = 0, Normal = 0,
High = 1, High = 1,

View File

@@ -161,6 +161,7 @@ namespace NzbDrone.Core.Organizer
AddMovieTokens(tokenHandlers, movie); AddMovieTokens(tokenHandlers, movie);
AddReleaseDateTokens(tokenHandlers, movie.Year); //In case we want to separate the year AddReleaseDateTokens(tokenHandlers, movie.Year); //In case we want to separate the year
AddImdbIdTokens(tokenHandlers, movie.ImdbId);
AddQualityTokens(tokenHandlers, movie, movieFile); AddQualityTokens(tokenHandlers, movie, movieFile);
AddMediaInfoTokens(tokenHandlers, movieFile); AddMediaInfoTokens(tokenHandlers, movieFile);
AddMovieFileTokens(tokenHandlers, movieFile); AddMovieFileTokens(tokenHandlers, movieFile);
@@ -301,6 +302,7 @@ namespace NzbDrone.Core.Organizer
AddMovieTokens(tokenHandlers, movie); AddMovieTokens(tokenHandlers, movie);
AddReleaseDateTokens(tokenHandlers, movie.Year); AddReleaseDateTokens(tokenHandlers, movie.Year);
AddImdbIdTokens(tokenHandlers, movie.ImdbId);
return CleanFolderName(ReplaceTokens(namingConfig.MovieFolderFormat, tokenHandlers, namingConfig)); return CleanFolderName(ReplaceTokens(namingConfig.MovieFolderFormat, tokenHandlers, namingConfig));
} }
@@ -477,6 +479,11 @@ namespace NzbDrone.Core.Organizer
tokenHandlers["{Release Year}"] = m => string.Format("{0}", releaseYear.ToString()); //Do I need m.CustomFormat? tokenHandlers["{Release Year}"] = m => string.Format("{0}", releaseYear.ToString()); //Do I need m.CustomFormat?
} }
private void AddImdbIdTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, string imdbId)
{
tokenHandlers["{IMDb Id}"] = m => $"{imdbId}";
}
private void AddSeasonTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, int seasonNumber) private void AddSeasonTokens(Dictionary<string, Func<TokenMatch, string>> tokenHandlers, int seasonNumber)
{ {
tokenHandlers["{Season}"] = m => seasonNumber.ToString(m.CustomFormat); tokenHandlers["{Season}"] = m => seasonNumber.ToString(m.CustomFormat);
@@ -508,6 +515,7 @@ namespace NzbDrone.Core.Organizer
{ {
tokenHandlers["{Original Title}"] = m => GetOriginalTitle(episodeFile); tokenHandlers["{Original Title}"] = m => GetOriginalTitle(episodeFile);
tokenHandlers["{Original Filename}"] = m => GetOriginalFileName(episodeFile); tokenHandlers["{Original Filename}"] = m => GetOriginalFileName(episodeFile);
//tokenHandlers["{IMDb Id}"] = m =>
tokenHandlers["{Release Group}"] = m => episodeFile.ReleaseGroup ?? m.DefaultValue("Sonarr"); tokenHandlers["{Release Group}"] = m => episodeFile.ReleaseGroup ?? m.DefaultValue("Sonarr");
} }

View File

@@ -47,7 +47,8 @@ namespace NzbDrone.Core.Organizer
_movie = new Movie _movie = new Movie
{ {
Title = "Movie Title", Title = "Movie Title",
Year = 2010 Year = 2010,
ImdbId = "tt0066921"
}; };
_standardSeries = new Series _standardSeries = new Series

View File

@@ -3,7 +3,7 @@ using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Datastore.Extensions;
namespace NzbDrone.Core.Tv namespace NzbDrone.Core.Tv
{ {
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.Tv
Movie FindByImdbId(string imdbid); Movie FindByImdbId(string imdbid);
Movie FindByTitleSlug(string slug); Movie FindByTitleSlug(string slug);
List<Movie> MoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored); List<Movie> MoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored);
PagingSpec<Movie> MoviesWithoutFiles(PagingSpec<Movie> pagingSpec);
List<Movie> GetMoviesByFileId(int fileId); List<Movie> GetMoviesByFileId(int fileId);
void SetFileId(int fileId, int movieId); void SetFileId(int fileId, int movieId);
} }
@@ -132,5 +133,21 @@ namespace NzbDrone.Core.Tv
return query.ToList(); return query.ToList();
} }
public PagingSpec<Movie> MoviesWithoutFiles(PagingSpec<Movie> pagingSpec)
{
var query = Query.Where(pagingSpec.FilterExpression)
.AndWhere(m => m.MovieFileId == 0)
.AndWhere(m => m.Status == MovieStatusType.Released)
.OrderBy(pagingSpec.OrderByClause(), pagingSpec.ToSortDirection())
.Skip(pagingSpec.PagingOffset())
.Take(pagingSpec.PageSize);
pagingSpec.Records = query.ToList();
pagingSpec.TotalRecords = pagingSpec.Records.Count;
return pagingSpec;
}
} }
} }

View File

@@ -12,6 +12,7 @@ using NzbDrone.Core.Parser;
using NzbDrone.Core.Tv.Events; using NzbDrone.Core.Tv.Events;
using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Tv namespace NzbDrone.Core.Tv
{ {
@@ -27,6 +28,7 @@ namespace NzbDrone.Core.Tv
Movie FindByTitleSlug(string slug); Movie FindByTitleSlug(string slug);
Movie GetMovieByFileId(int fileId); Movie GetMovieByFileId(int fileId);
List<Movie> GetMoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored); List<Movie> GetMoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored);
PagingSpec<Movie> MoviesWithoutFiles(PagingSpec<Movie> pagingSpec);
void DeleteMovie(int movieId, bool deleteFiles); void DeleteMovie(int movieId, bool deleteFiles);
List<Movie> GetAllMovies(); List<Movie> GetAllMovies();
Movie UpdateMovie(Movie movie); Movie UpdateMovie(Movie movie);
@@ -232,5 +234,12 @@ namespace NzbDrone.Core.Tv
return episodes; return episodes;
} }
public PagingSpec<Movie> MoviesWithoutFiles(PagingSpec<Movie> pagingSpec)
{
var movieResult = _movieRepository.MoviesWithoutFiles(pagingSpec);
return movieResult;
}
} }
} }

View File

@@ -0,0 +1,42 @@
var NzbDroneCell = require('./NzbDroneCell');
//used in Wanted tab
module.exports = NzbDroneCell.extend({
className : 'movie-status-text-cell',
render : function() {
this.$el.empty();
var monitored = this.model.get('monitored');
var status = this.model.get('status');
var inCinemas = this.model.get("inCinemas");
var date = new Date(inCinemas);
var timeSince = new Date().getTime() - date.getTime();
var numOfMonths = timeSince / 1000 / 60 / 60 / 24 / 30;
if (status === 'released') {
this.$el.html('<div class="released-banner"><i class="icon-sonarr-movie-released grid-icon" title=""></i>&nbsp;Released</div>');
this._setStatusWeight(3);
}
if (numOfMonths > 3) {
this.$el.html('<div class="released-banner"><i class="icon-sonarr-movie-released grid-icon" title=""></i>&nbsp;Released</div>');//TODO: Update for PreDB.me
this._setStatusWeight(2);
}
if (numOfMonths < 3) {
this.$el.html('<div class="cinemas-banner"><i class="icon-sonarr-movie-cinemas grid-icon" title=""></i>&nbsp;In Cinemas</div>');
this._setStatusWeight(2);
}
if (status === "announced") {
this.$el.html('<div class="announced-banner"><i class="icon-sonarr-movie-announced grid-icon" title=""></i>&nbsp;Announced</div>');
this._setStatusWeight(1);
}
return this;
},
_setStatusWeight : function(weight) {
this.model.set('statusWeight', weight, { silent : true });
}
});

View File

@@ -55,6 +55,10 @@
width : 150px; width : 150px;
} }
.movie-status-text-cell {
width : 150px;
}
.history-event-type-cell { .history-event-type-cell {
width : 10px; width : 10px;
} }

View File

@@ -18,7 +18,7 @@
<div class="center"> <div class="center">
<div class="labels"> <div class="labels">
<span class="label label-{{DownloadedStatusColor}}" title="{{DownloadedQuality}}">{{DownloadedStatus}}</span>
{{#if website}} {{#if website}}
<a href="{{homepage}}" class="label label-info">Homepage</a> <a href="{{homepage}}" class="label label-info">Homepage</a>
{{/if}} {{/if}}

View File

@@ -126,7 +126,7 @@
.card; .card;
.clickable; .clickable;
margin-bottom : 20px; margin-bottom : 20px;
height : 344px; height : 363px;
.center { .center {
display : block; display : block;
@@ -166,7 +166,7 @@
} }
@media (max-width: @screen-xs-max) { @media (max-width: @screen-xs-max) {
height : 268px; height : 283px;
margin : 5px; margin : 5px;
padding : 6px 5px; padding : 6px 5px;

View File

@@ -72,6 +72,7 @@
{{> MediaInfoNamingPartial}} {{> MediaInfoNamingPartial}}
{{> ReleaseGroupNamingPartial}} {{> ReleaseGroupNamingPartial}}
{{> OriginalTitleNamingPartial}} {{> OriginalTitleNamingPartial}}
{{> ImdbIdNamingPartial}}
{{> SeparatorNamingPartial}} {{> SeparatorNamingPartial}}
</ul> </ul>
</div> </div>
@@ -161,6 +162,7 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{{> MovieTitleNamingPartial}} {{> MovieTitleNamingPartial}}
{{> ReleaseYearNamingPartial}} {{> ReleaseYearNamingPartial}}
{{> ImdbIdNamingPartial}}
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -0,0 +1 @@
<li><a href="#" data-token="IMDb Id">IMDb Id</a></li>

View File

@@ -1,5 +1,5 @@
var _ = require('underscore'); var _ = require('underscore');
var EpisodeModel = require('../../Series/EpisodeModel'); var MovieModel = require('../../Movies/MovieModel');
var PagableCollection = require('backbone.pageable'); var PagableCollection = require('backbone.pageable');
var AsFilteredCollection = require('../../Mixins/AsFilteredCollection'); var AsFilteredCollection = require('../../Mixins/AsFilteredCollection');
var AsSortedCollection = require('../../Mixins/AsSortedCollection'); var AsSortedCollection = require('../../Mixins/AsSortedCollection');
@@ -7,13 +7,13 @@ var AsPersistedStateCollection = require('../../Mixins/AsPersistedStateCollectio
var Collection = PagableCollection.extend({ var Collection = PagableCollection.extend({
url : window.NzbDrone.ApiRoot + '/wanted/missing', url : window.NzbDrone.ApiRoot + '/wanted/missing',
model : EpisodeModel, model : MovieModel,
tableName : 'wanted.missing', tableName : 'wanted.missing',
state : { state : {
pageSize : 15, pageSize : 15,
sortKey : 'airDateUtc', sortKey : 'inCinemas',
order : 1 order : -1
}, },
queryParams : { queryParams : {
@@ -39,10 +39,6 @@ var Collection = PagableCollection.extend({
] ]
}, },
sortMappings : {
'series' : { sortKey : 'series.sortTitle' }
},
parseState : function(resp) { parseState : function(resp) {
return { totalRecords : resp.totalRecords }; return { totalRecords : resp.totalRecords };
}, },
@@ -58,4 +54,4 @@ var Collection = PagableCollection.extend({
Collection = AsFilteredCollection.call(Collection); Collection = AsFilteredCollection.call(Collection);
Collection = AsSortedCollection.call(Collection); Collection = AsSortedCollection.call(Collection);
module.exports = AsPersistedStateCollection.call(Collection); module.exports = AsPersistedStateCollection.call(Collection);

View File

@@ -5,11 +5,9 @@ var Marionette = require('marionette');
var Backgrid = require('backgrid'); var Backgrid = require('backgrid');
var MissingCollection = require('./MissingCollection'); var MissingCollection = require('./MissingCollection');
var SelectAllCell = require('../../Cells/SelectAllCell'); var SelectAllCell = require('../../Cells/SelectAllCell');
var SeriesTitleCell = require('../../Cells/SeriesTitleCell'); var MovieTitleCell = require('../../Cells/MovieTitleCell');
var EpisodeNumberCell = require('../../Cells/EpisodeNumberCell');
var EpisodeTitleCell = require('../../Cells/EpisodeTitleCell');
var RelativeDateCell = require('../../Cells/RelativeDateCell'); var RelativeDateCell = require('../../Cells/RelativeDateCell');
var EpisodeStatusCell = require('../../Cells/EpisodeStatusCell'); var MovieStatusWithTextCell = require('../../Cells/MovieStatusWithTextCell');
var GridPager = require('../../Shared/Grid/Pager'); var GridPager = require('../../Shared/Grid/Pager');
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout'); var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
var LoadingView = require('../../Shared/LoadingView'); var LoadingView = require('../../Shared/LoadingView');
@@ -39,35 +37,29 @@ module.exports = Marionette.Layout.extend({
headerCell : 'select-all', headerCell : 'select-all',
sortable : false sortable : false
}, },
{
name : 'series',
label : 'Series Title',
cell : SeriesTitleCell,
sortValue : 'series.sortTitle'
},
{ {
name : 'this', name : 'this',
label : 'Episode', label : 'Movie Title',
cell : EpisodeNumberCell, cell : MovieTitleCell,
sortable : false sortable : false
}, },
{ {
name : 'this', name : 'inCinemas',
label : 'Episode Title', label : 'In Cinemas',
cell : EpisodeTitleCell, cell : RelativeDateCell
sortable : false
}, },
{ {
name : 'airDateUtc', name : 'physicalRelease',
label : 'Air Date', label : 'PhysicalRelease',
cell : RelativeDateCell cell : RelativeDateCell
}, },
{ {
name : 'status', name : 'status',
label : 'Status', label : 'Status',
cell : EpisodeStatusCell, cell : MovieStatusWithTextCell,
sortable : false sortable : false
} },
], ],
initialize : function() { initialize : function() {