1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-17 21:26:22 -04:00
Files
Radarr/src/NzbDrone.Core/Download/Pending/PendingReleaseRepository.cs
Devin Buhl 1db3669afa 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
2017-02-12 06:57:07 -05:00

42 lines
1.2 KiB
C#

using System.Collections.Generic;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Download.Pending
{
public interface IPendingReleaseRepository : IBasicRepository<PendingRelease>
{
void DeleteBySeriesId(int seriesId);
List<PendingRelease> AllBySeriesId(int seriesId);
void DeleteByMovieId(int movieId);
List<PendingRelease> AllByMovieId(int movieId);
}
public class PendingReleaseRepository : BasicRepository<PendingRelease>, IPendingReleaseRepository
{
public PendingReleaseRepository(IMainDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
public void DeleteBySeriesId(int seriesId)
{
Delete(r => r.SeriesId == seriesId);
}
public List<PendingRelease> AllBySeriesId(int seriesId)
{
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);
}
}
}