mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 05:44:50 +00:00
fixup! Remove db calls from list threads
This commit is contained in:
parent
3f6f4fc65f
commit
b279984bd7
1 changed files with 14 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
using NzbDrone.Core.ImportLists;
|
||||
using NzbDrone.Core.ImportLists.ImportExclusions;
|
||||
using NzbDrone.Core.ImportLists.ImportListMovies;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
using NzbDrone.Core.Movies;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
|
@ -59,8 +60,7 @@ public void Setup()
|
|||
_importListFetch = new ImportListFetchResult
|
||||
{
|
||||
Movies = _list1Movies,
|
||||
AnyFailure = false,
|
||||
SyncedLists = new List<int> { 1 }
|
||||
AnyFailure = false
|
||||
};
|
||||
|
||||
_commandAll = new ImportListSyncCommand
|
||||
|
@ -84,6 +84,10 @@ public void Setup()
|
|||
.Setup(v => v.MovieExists(It.IsAny<Movie>()))
|
||||
.Returns(false);
|
||||
|
||||
Mocker.GetMock<IMovieService>()
|
||||
.Setup(v => v.MovieExists(It.IsAny<Movie>()))
|
||||
.Returns(false);
|
||||
|
||||
Mocker.GetMock<IMovieService>()
|
||||
.Setup(v => v.AllMovieTmdbIds())
|
||||
.Returns(new List<int>());
|
||||
|
@ -91,6 +95,10 @@ public void Setup()
|
|||
Mocker.GetMock<IFetchAndParseImportList>()
|
||||
.Setup(v => v.Fetch())
|
||||
.Returns(_importListFetch);
|
||||
|
||||
Mocker.GetMock<ISearchForNewMovie>()
|
||||
.Setup(v => v.MapMovieToTmdbMovie(It.IsAny<MovieMetadata>()))
|
||||
.Returns<MovieMetadata>(m => new MovieMetadata { TmdbId = m.TmdbId });
|
||||
}
|
||||
|
||||
private void GivenListFailure()
|
||||
|
@ -101,6 +109,7 @@ private void GivenListFailure()
|
|||
private void GivenNoListSync()
|
||||
{
|
||||
_importListFetch.SyncedLists = new List<int>();
|
||||
_importListFetch.SyncedWithoutFailure = new List<int>();
|
||||
}
|
||||
|
||||
private void GivenCleanLevel(string cleanLevel)
|
||||
|
@ -114,6 +123,9 @@ private void GivenList(int id, bool enabledAuto)
|
|||
{
|
||||
var importListDefinition = new ImportListDefinition { Id = id, EnableAuto = enabledAuto };
|
||||
|
||||
_importListFetch.SyncedLists.Add(id);
|
||||
_importListFetch.SyncedWithoutFailure.Add(id);
|
||||
|
||||
Mocker.GetMock<IImportListFactory>()
|
||||
.Setup(v => v.Get(id))
|
||||
.Returns(importListDefinition);
|
||||
|
|
Loading…
Reference in a new issue