Patch/onedr0p (#716)

* Alter IMDb lists to what was requested: #697

* Update Pending Release

* Tests (these need to be updated further)

* Alter table migration, movieId already exists

* Update HouseKeeping for pending release

* Fix migratiom and pendingrelease housekeeping
pull/2/head
Devin Buhl 8 years ago committed by GitHub
parent 93e55b7575
commit 1db3669afa

@ -26,7 +26,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
{
private Profile _profile;
private DelayProfile _delayProfile;
private RemoteEpisode _remoteEpisode;
private RemoteMovie _remoteEpisode;
[SetUp]
public void Setup()
@ -38,12 +38,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
.With(d => d.PreferredProtocol = DownloadProtocol.Usenet)
.Build();
var series = Builder<Series>.CreateNew()
var series = Builder<Movie>.CreateNew()
.With(s => s.Profile = _profile)
.Build();
_remoteEpisode = Builder<RemoteEpisode>.CreateNew()
.With(r => r.Series = series)
_remoteEpisode = Builder<RemoteMovie>.CreateNew()
.With(r => r.Movie = series)
.Build();
_profile.Items = new List<ProfileQualityItem>();
@ -53,30 +53,30 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
_profile.Cutoff = Quality.WEBDL720p;
_remoteEpisode.ParsedEpisodeInfo = new ParsedEpisodeInfo();
_remoteEpisode.ParsedMovieInfo = new ParsedMovieInfo();
_remoteEpisode.Release = new ReleaseInfo();
_remoteEpisode.Release.DownloadProtocol = DownloadProtocol.Usenet;
_remoteEpisode.Episodes = Builder<Episode>.CreateListOfSize(1).Build().ToList();
_remoteEpisode.Episodes.First().EpisodeFileId = 0;
//_remoteEpisode.Episodes = Builder<Episode>.CreateListOfSize(1).Build().ToList();
//_remoteEpisode.Episodes.First().EpisodeFileId = 0;
Mocker.GetMock<IDelayProfileService>()
.Setup(s => s.BestForTags(It.IsAny<HashSet<int>>()))
.Returns(_delayProfile);
//Mocker.GetMock<IDelayProfileService>()
// .Setup(s => s.BestForTags(It.IsAny<HashSet<int>>()))
// .Returns(_delayProfile);
Mocker.GetMock<IPendingReleaseService>()
.Setup(s => s.GetPendingRemoteEpisodes(It.IsAny<int>()))
.Returns(new List<RemoteEpisode>());
//Mocker.GetMock<IPendingReleaseService>()
// .Setup(s => s.GetPendingRemoteEpisodes(It.IsAny<int>()))
// .Returns(new List<RemoteEpisode>());
}
private void GivenExistingFile(QualityModel quality)
{
_remoteEpisode.Episodes.First().EpisodeFileId = 1;
//_remoteEpisode.Episodes.First().EpisodeFileId = 1;
_remoteEpisode.Episodes.First().EpisodeFile = new LazyLoaded<EpisodeFile>(new EpisodeFile
{
Quality = quality
});
//_remoteEpisode.Episodes.First().EpisodeFile = new LazyLoaded<EpisodeFile>(new EpisodeFile
// {
// Quality = quality
// });
}
private void GivenUpgradeForExistingFile()

@ -20,22 +20,19 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
public class RemoveGrabbedFixture : CoreTest<PendingReleaseService>
{
private DownloadDecision _temporarilyRejected;
private Series _series;
private Movie _series;
private Episode _episode;
private Profile _profile;
private ReleaseInfo _release;
private ParsedEpisodeInfo _parsedEpisodeInfo;
private RemoteEpisode _remoteEpisode;
private ParsedMovieInfo _parsedEpisodeInfo;
private RemoteMovie _remoteEpisode;
[SetUp]
public void Setup()
{
_series = Builder<Series>.CreateNew()
_series = Builder<Movie>.CreateNew()
.Build();
_episode = Builder<Episode>.CreateNew()
.Build();
_profile = new Profile
{
Name = "Test",
@ -52,13 +49,13 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
_release = Builder<ReleaseInfo>.CreateNew().Build();
_parsedEpisodeInfo = Builder<ParsedEpisodeInfo>.CreateNew().Build();
_parsedEpisodeInfo = Builder<ParsedMovieInfo>.CreateNew().Build();
_parsedEpisodeInfo.Quality = new QualityModel(Quality.HDTV720p);
_remoteEpisode = new RemoteEpisode();
_remoteEpisode.Episodes = new List<Episode>{ _episode };
_remoteEpisode.Series = _series;
_remoteEpisode.ParsedEpisodeInfo = _parsedEpisodeInfo;
_remoteEpisode = new RemoteMovie();
//_remoteEpisode.Episodes = new List<Episode>{ _episode };
_remoteEpisode.Movie = _series;
_remoteEpisode.ParsedMovieInfo = _parsedEpisodeInfo;
_remoteEpisode.Release = _release;
_temporarilyRejected = new DownloadDecision(_remoteEpisode, new Rejection("Temp Rejected", RejectionType.Temporary));
@ -67,13 +64,13 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
.Setup(s => s.All())
.Returns(new List<PendingRelease>());
Mocker.GetMock<ISeriesService>()
.Setup(s => s.GetSeries(It.IsAny<int>()))
Mocker.GetMock<IMovieService>()
.Setup(s => s.GetMovie(It.IsAny<int>()))
.Returns(_series);
Mocker.GetMock<IParsingService>()
.Setup(s => s.GetEpisodes(It.IsAny<ParsedEpisodeInfo>(), _series, true, null))
.Returns(new List<Episode> {_episode});
//Mocker.GetMock<IParsingService>()
// .Setup(s => s.GetMovie(It.IsAny<ParsedMovieInfo>(), _series.Title))
// .Returns(_episode);
Mocker.GetMock<IPrioritizeDownloadDecision>()
.Setup(s => s.PrioritizeDecisions(It.IsAny<List<DownloadDecision>>()))
@ -89,7 +86,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
.All()
.With(h => h.SeriesId = _series.Id)
.With(h => h.Release = _release.JsonClone())
.With(h => h.ParsedEpisodeInfo = parsedEpisodeInfo)
.With(h => h.ParsedMovieInfo = _parsedEpisodeInfo)
.Build();
Mocker.GetMock<IPendingReleaseRepository>()
@ -102,7 +99,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
{
GivenHeldRelease(_parsedEpisodeInfo.Quality);
Subject.Handle(new EpisodeGrabbedEvent(_remoteEpisode));
Subject.Handle(new MovieGrabbedEvent(_remoteEpisode));
VerifyDelete();
}
@ -112,7 +109,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
{
GivenHeldRelease(new QualityModel(Quality.SDTV));
Subject.Handle(new EpisodeGrabbedEvent(_remoteEpisode));
Subject.Handle(new MovieGrabbedEvent(_remoteEpisode));
VerifyDelete();
}
@ -122,7 +119,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
{
GivenHeldRelease(new QualityModel(Quality.Bluray720p));
Subject.Handle(new EpisodeGrabbedEvent(_remoteEpisode));
Subject.Handle(new MovieGrabbedEvent(_remoteEpisode));
VerifyNoDelete();
}

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
using System.Data;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(129)]
public class add_parsed_movie_info_to_pending_release : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("PendingReleases").AddColumn("ParsedMovieInfo").AsString().Nullable();
}
}
}

@ -91,19 +91,19 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
return Decision.Accept();
}
/*
var oldest = _pendingReleaseService.OldestPendingRelease(subject.Series.Id, episodeIds);
var oldest = _pendingReleaseService.OldestPendingRelease(subject.Movie.Id);
if (oldest != null && oldest.Release.AgeMinutes > delay)
{
return Decision.Accept();
}*/
}
if (subject.Release.AgeMinutes < delay)
{
_logger.Debug("Waiting for better quality release, There is a {0} minute delay on {1}", delay, subject.Release.DownloadProtocol);
return Decision.Reject("Waiting for better quality release");
} //TODO: Update for movies!
}
return Decision.Accept();
}
@ -158,14 +158,14 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
return Decision.Accept();
}
var episodeIds = subject.Episodes.Select(e => e.Id);
// var episodeIds = subject.Episodes.Select(e => e.Id);
var oldest = _pendingReleaseService.OldestPendingRelease(subject.Series.Id, episodeIds);
//var oldest = _pendingReleaseService.OldestPendingRelease(subject.Series.Id, episodeIds);
if (oldest != null && oldest.Release.AgeMinutes > delay)
{
return Decision.Accept();
}
//if (oldest != null && oldest.Release.AgeMinutes > delay)
//{
// return Decision.Accept();
//}
if (subject.Release.AgeMinutes < delay)
{

@ -11,6 +11,7 @@ namespace NzbDrone.Core.Download.Pending
public string Title { get; set; }
public DateTime Added { get; set; }
public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; }
public ParsedMovieInfo ParsedMovieInfo { get; set; }
public ReleaseInfo Release { get; set; }
//Not persisted

@ -8,6 +8,8 @@ namespace NzbDrone.Core.Download.Pending
{
void DeleteBySeriesId(int seriesId);
List<PendingRelease> AllBySeriesId(int seriesId);
void DeleteByMovieId(int movieId);
List<PendingRelease> AllByMovieId(int movieId);
}
public class PendingReleaseRepository : BasicRepository<PendingRelease>, IPendingReleaseRepository
@ -26,5 +28,15 @@ namespace NzbDrone.Core.Download.Pending
{
return Query.Where(p => p.SeriesId == seriesId);
}
public void DeleteByMovieId(int movieId)
{
Delete(r => r.MovieId == movieId);
}
public List<PendingRelease> AllByMovieId(int movieId)
{
return Query.Where(p => p.MovieId == movieId);
}
}
}

@ -23,22 +23,21 @@ namespace NzbDrone.Core.Download.Pending
void Add(DownloadDecision decision);
List<ReleaseInfo> GetPending();
List<RemoteEpisode> GetPendingRemoteEpisodes(int seriesId);
List<RemoteMovie> GetPendingRemoteMovies(int movieId);
List<Queue.Queue> GetPendingQueue();
Queue.Queue FindPendingQueueItem(int queueId);
void RemovePendingQueueItems(int queueId);
RemoteEpisode OldestPendingRelease(int seriesId, IEnumerable<int> episodeIds);
RemoteMovie OldestPendingRelease(int movieId);
}
public class PendingReleaseService : IPendingReleaseService,
IHandle<SeriesDeletedEvent>,
IHandle<EpisodeGrabbedEvent>,
IHandle<MovieGrabbedEvent>,
IHandle<MovieDeletedEvent>,
IHandle<RssSyncCompleteEvent>
{
private readonly IIndexerStatusService _indexerStatusService;
private readonly IPendingReleaseRepository _repository;
private readonly ISeriesService _seriesService;
private readonly IMovieService _movieService;
private readonly IParsingService _parsingService;
private readonly IDelayProfileService _delayProfileService;
private readonly ITaskManager _taskManager;
@ -48,7 +47,7 @@ namespace NzbDrone.Core.Download.Pending
public PendingReleaseService(IIndexerStatusService indexerStatusService,
IPendingReleaseRepository repository,
ISeriesService seriesService,
IMovieService movieService,
IParsingService parsingService,
IDelayProfileService delayProfileService,
ITaskManager taskManager,
@ -58,7 +57,7 @@ namespace NzbDrone.Core.Download.Pending
{
_indexerStatusService = indexerStatusService;
_repository = repository;
_seriesService = seriesService;
_movieService = movieService;
_parsingService = parsingService;
_delayProfileService = delayProfileService;
_taskManager = taskManager;
@ -72,13 +71,11 @@ namespace NzbDrone.Core.Download.Pending
{
var alreadyPending = GetPendingReleases();
var episodeIds = decision.RemoteEpisode.Episodes.Select(e => e.Id);
var movieId = decision.RemoteMovie.Movie.Id;
var existingReports = alreadyPending.Where(r => r.RemoteEpisode.Episodes.Select(e => e.Id)
.Intersect(episodeIds)
.Any());
var existingReports = alreadyPending.Where(r => r.RemoteMovie.Movie.Id == movieId);
if (existingReports.Any(MatchingReleasePredicate(decision.RemoteEpisode.Release)))
if (existingReports.Any(MatchingReleasePredicate(decision.RemoteMovie.Release)))
{
_logger.Debug("This release is already pending, not adding again");
return;
@ -107,9 +104,9 @@ namespace NzbDrone.Core.Download.Pending
return releases.Where(release => !blockedIndexers.Contains(release.IndexerId)).ToList();
}
public List<RemoteEpisode> GetPendingRemoteEpisodes(int seriesId)
public List<RemoteMovie> GetPendingRemoteMovies(int movieId)
{
return _repository.AllBySeriesId(seriesId).Select(GetRemoteEpisode).ToList();
return _repository.AllByMovieId(movieId).Select(GetRemoteMovie).ToList();
}
public List<Queue.Queue> GetPendingQueue()
@ -120,9 +117,9 @@ namespace NzbDrone.Core.Download.Pending
foreach (var pendingRelease in GetPendingReleases())
{
foreach (var episode in pendingRelease.RemoteEpisode.Episodes)
{
var ect = pendingRelease.Release.PublishDate.AddMinutes(GetDelay(pendingRelease.RemoteEpisode));
//foreach (var episode in pendingRelease.RemoteEpisode.Episodes)
//{
var ect = pendingRelease.Release.PublishDate.AddMinutes(GetDelay(pendingRelease.RemoteMovie));
if (ect < nextRssSync.Value)
{
@ -135,21 +132,22 @@ namespace NzbDrone.Core.Download.Pending
var queue = new Queue.Queue
{
Id = GetQueueId(pendingRelease, episode),
Series = pendingRelease.RemoteEpisode.Series,
Episode = episode,
Quality = pendingRelease.RemoteEpisode.ParsedEpisodeInfo.Quality,
Id = GetQueueId(pendingRelease, pendingRelease.RemoteMovie.Movie),
Series = null,
Episode = null,
Movie = pendingRelease.RemoteMovie.Movie,
Quality = pendingRelease.RemoteMovie.ParsedMovieInfo.Quality,
Title = pendingRelease.Title,
Size = pendingRelease.RemoteEpisode.Release.Size,
Sizeleft = pendingRelease.RemoteEpisode.Release.Size,
RemoteEpisode = pendingRelease.RemoteEpisode,
Size = pendingRelease.RemoteMovie.Release.Size,
Sizeleft = pendingRelease.RemoteMovie.Release.Size,
RemoteMovie = pendingRelease.RemoteMovie,
Timeleft = ect.Subtract(DateTime.UtcNow),
EstimatedCompletionTime = ect,
Status = "Pending",
Protocol = pendingRelease.RemoteEpisode.Release.DownloadProtocol
Protocol = pendingRelease.RemoteMovie.Release.DownloadProtocol
};
queued.Add(queue);
}
//}
}
//Return best quality release for each episode
@ -158,7 +156,7 @@ namespace NzbDrone.Core.Download.Pending
var series = g.First().Series;
return g.OrderByDescending(e => e.Quality, new QualityModelComparer(series.Profile))
.ThenBy(q => PrioritizeDownloadProtocol(q.Series, q.Protocol))
.ThenBy(q => PrioritizeDownloadProtocol(q.Movie, q.Protocol))
.First();
});
@ -173,20 +171,16 @@ namespace NzbDrone.Core.Download.Pending
public void RemovePendingQueueItems(int queueId)
{
var targetItem = FindPendingRelease(queueId);
var seriesReleases = _repository.AllBySeriesId(targetItem.SeriesId);
var movieReleases = _repository.AllByMovieId(targetItem.MovieId);
var releasesToRemove = seriesReleases.Where(
c => c.ParsedEpisodeInfo.SeasonNumber == targetItem.ParsedEpisodeInfo.SeasonNumber &&
c.ParsedEpisodeInfo.EpisodeNumbers.SequenceEqual(targetItem.ParsedEpisodeInfo.EpisodeNumbers));
var releasesToRemove = movieReleases.Where(c => c.ParsedMovieInfo.MovieTitle == targetItem.ParsedMovieInfo.MovieTitle);
_repository.DeleteMany(releasesToRemove.Select(c => c.Id));
}
public RemoteEpisode OldestPendingRelease(int seriesId, IEnumerable<int> episodeIds)
public RemoteMovie OldestPendingRelease(int movieId)
{
return GetPendingRemoteEpisodes(seriesId).Where(r => r.Episodes.Select(e => e.Id).Intersect(episodeIds).Any())
.OrderByDescending(p => p.Release.AgeHours)
.FirstOrDefault();
return GetPendingRemoteMovies(movieId).OrderByDescending(p => p.Release.AgeHours).FirstOrDefault();
}
private List<PendingRelease> GetPendingReleases()
@ -195,11 +189,11 @@ namespace NzbDrone.Core.Download.Pending
foreach (var release in _repository.All())
{
var remoteEpisode = GetRemoteEpisode(release);
var remoteMovie = GetRemoteMovie(release);
if (remoteEpisode == null) continue;
if (remoteMovie == null) continue;
release.RemoteEpisode = remoteEpisode;
release.RemoteMovie = remoteMovie;
result.Add(release);
}
@ -207,20 +201,19 @@ namespace NzbDrone.Core.Download.Pending
return result;
}
private RemoteEpisode GetRemoteEpisode(PendingRelease release)
private RemoteMovie GetRemoteMovie(PendingRelease release)
{
var series = _seriesService.GetSeries(release.SeriesId);
var movie = _movieService.GetMovie(release.MovieId);
//Just in case the series was removed, but wasn't cleaned up yet (housekeeper will clean it up)
if (series == null) return null;
if (movie == null) return null;
var episodes = _parsingService.GetEpisodes(release.ParsedEpisodeInfo, series, true);
// var episodes = _parsingService.GetMovie(release.ParsedMovieInfo.MovieTitle);
return new RemoteEpisode
return new RemoteMovie
{
Series = series,
Episodes = episodes,
ParsedEpisodeInfo = release.ParsedEpisodeInfo,
Movie = movie,
ParsedMovieInfo = release.ParsedMovieInfo,
Release = release.Release
};
}
@ -229,10 +222,10 @@ namespace NzbDrone.Core.Download.Pending
{
_repository.Insert(new PendingRelease
{
SeriesId = decision.RemoteEpisode.Series.Id,
ParsedEpisodeInfo = decision.RemoteEpisode.ParsedEpisodeInfo,
Release = decision.RemoteEpisode.Release,
Title = decision.RemoteEpisode.Release.Title,
MovieId = decision.RemoteMovie.Movie.Id,
ParsedMovieInfo = decision.RemoteMovie.ParsedMovieInfo,
Release = decision.RemoteMovie.Release,
Title = decision.RemoteMovie.Release.Title,
Added = DateTime.UtcNow
});
@ -252,46 +245,46 @@ namespace NzbDrone.Core.Download.Pending
p.Release.Indexer == release.Indexer;
}
private int GetDelay(RemoteEpisode remoteEpisode)
private int GetDelay(RemoteMovie remoteMovie)
{
var delayProfile = _delayProfileService.AllForTags(remoteEpisode.Series.Tags).OrderBy(d => d.Order).First();
var delay = delayProfile.GetProtocolDelay(remoteEpisode.Release.DownloadProtocol);
var delayProfile = _delayProfileService.AllForTags(remoteMovie.Movie.Tags).OrderBy(d => d.Order).First();
var delay = delayProfile.GetProtocolDelay(remoteMovie.Release.DownloadProtocol);
var minimumAge = _configService.MinimumAge;
return new[] { delay, minimumAge }.Max();
}
private void RemoveGrabbed(RemoteEpisode remoteEpisode)
{
var pendingReleases = GetPendingReleases();
var episodeIds = remoteEpisode.Episodes.Select(e => e.Id);
var existingReports = pendingReleases.Where(r => r.RemoteEpisode.Episodes.Select(e => e.Id)
.Intersect(episodeIds)
.Any())
.ToList();
if (existingReports.Empty())
{
return;
}
var profile = remoteEpisode.Series.Profile.Value;
foreach (var existingReport in existingReports)
{
var compare = new QualityModelComparer(profile).Compare(remoteEpisode.ParsedEpisodeInfo.Quality,
existingReport.RemoteEpisode.ParsedEpisodeInfo.Quality);
//Only remove lower/equal quality pending releases
//It is safer to retry these releases on the next round than remove it and try to re-add it (if its still in the feed)
if (compare >= 0)
{
_logger.Debug("Removing previously pending release, as it was grabbed.");
Delete(existingReport);
}
}
}
//private void RemoveGrabbed(RemoteEpisode remoteEpisode)
//{
// var pendingReleases = GetPendingReleases();
// var episodeIds = remoteEpisode.Episodes.Select(e => e.Id);
// var existingReports = pendingReleases.Where(r => r.RemoteEpisode.Episodes.Select(e => e.Id)
// .Intersect(episodeIds)
// .Any())
// .ToList();
// if (existingReports.Empty())
// {
// return;
// }
// var profile = remoteEpisode.Series.Profile.Value;
// foreach (var existingReport in existingReports)
// {
// var compare = new QualityModelComparer(profile).Compare(remoteEpisode.ParsedEpisodeInfo.Quality,
// existingReport.RemoteEpisode.ParsedEpisodeInfo.Quality);
// //Only remove lower/equal quality pending releases
// //It is safer to retry these releases on the next round than remove it and try to re-add it (if its still in the feed)
// if (compare >= 0)
// {
// _logger.Debug("Removing previously pending release, as it was grabbed.");
// Delete(existingReport);
// }
// }
//}
private void RemoveRejected(List<DownloadDecision> rejected)
{
@ -300,7 +293,7 @@ namespace NzbDrone.Core.Download.Pending
foreach (var rejectedRelease in rejected)
{
var matching = pending.Where(MatchingReleasePredicate(rejectedRelease.RemoteEpisode.Release));
var matching = pending.Where(MatchingReleasePredicate(rejectedRelease.RemoteMovie.Release));
foreach (var pendingRelease in matching)
{
@ -312,17 +305,17 @@ namespace NzbDrone.Core.Download.Pending
private PendingRelease FindPendingRelease(int queueId)
{
return GetPendingReleases().First(p => p.RemoteEpisode.Episodes.Any(e => queueId == GetQueueId(p, e)));
return GetPendingReleases().First(p => queueId == GetQueueId(p, p.RemoteMovie.Movie));
}
private int GetQueueId(PendingRelease pendingRelease, Episode episode)
private int GetQueueId(PendingRelease pendingRelease, Movie movie)
{
return HashConverter.GetHashInt31(string.Format("pending-{0}-ep{1}", pendingRelease.Id, episode.Id));
return HashConverter.GetHashInt31(string.Format("pending-{0}-movie{1}", pendingRelease.Id, movie.Id));
}
private int PrioritizeDownloadProtocol(Series series, DownloadProtocol downloadProtocol)
private int PrioritizeDownloadProtocol(Movie movie, DownloadProtocol downloadProtocol)
{
var delayProfile = _delayProfileService.BestForTags(series.Tags);
var delayProfile = _delayProfileService.BestForTags(movie.Tags);
if (downloadProtocol == delayProfile.PreferredProtocol)
{
@ -332,14 +325,9 @@ namespace NzbDrone.Core.Download.Pending
return 1;
}
public void Handle(SeriesDeletedEvent message)
{
_repository.DeleteBySeriesId(message.Series.Id);
}
public void Handle(EpisodeGrabbedEvent message)
public void Handle(MovieDeletedEvent message)
{
RemoveGrabbed(message.Episode);
_repository.DeleteByMovieId(message.Movie.Id);
}
public void Handle(MovieGrabbedEvent message)

@ -18,9 +18,9 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
mapper.ExecuteNonQuery(@"DELETE FROM PendingReleases
WHERE Id IN (
SELECT PendingReleases.Id FROM PendingReleases
LEFT OUTER JOIN Series
ON PendingReleases.SeriesId = Series.Id
WHERE Series.Id IS NULL)");
LEFT OUTER JOIN Movies
ON PendingReleases.MovieId = Movies.Id
WHERE Movies.Id IS NULL)");
}
}
}

@ -33,13 +33,22 @@ namespace NzbDrone.Core.NetImport.RSSImport
}
yield return new NetImportDefinition
{
Name = "IMDb Watchlist",
Name = "IMDb List",
Enabled = Enabled,
EnableAuto = true,
ProfileId = 1,
Implementation = GetType().Name,
Settings = new RSSImportSettings { Link = "http://rss.imdb.com/list/YOURLISTID" },
};
yield return new NetImportDefinition
{
Name = "IMDb Watchlist",
Enabled = Enabled,
EnableAuto = true,
ProfileId = 1,
Implementation = GetType().Name,
Settings = new RSSImportSettings { Link = "http://rss.imdb.com/user/IMDBUSERID/watchlist" },
};
}
}

@ -124,6 +124,7 @@
<Compile Include="Authentication\UserRepository.cs" />
<Compile Include="Authentication\UserService.cs" />
<Compile Include="Datastore\Migration\123_create_netimport_table.cs" />
<Compile Include="Datastore\Migration\129_add_parsed_movie_info_to_pending_release.cs" />
<Compile Include="Datastore\Migration\128_remove_kickass.cs" />
<Compile Include="NetImport\Trakt\TraktAPI.cs" />
<Compile Include="NetImport\Trakt\TraktImport.cs" />

Loading…
Cancel
Save