mirror of
https://github.com/Radarr/Radarr.git
synced 2026-03-05 13:21:25 -05:00
fixup! Remove db calls from list threads
This commit is contained in:
@@ -7,6 +7,7 @@ using NzbDrone.Core.Configuration;
|
||||
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 @@ namespace NzbDrone.Core.Test.ImportList
|
||||
_importListFetch = new ImportListFetchResult
|
||||
{
|
||||
Movies = _list1Movies,
|
||||
AnyFailure = false,
|
||||
SyncedLists = new List<int> { 1 }
|
||||
AnyFailure = false
|
||||
};
|
||||
|
||||
_commandAll = new ImportListSyncCommand
|
||||
@@ -84,6 +84,10 @@ namespace NzbDrone.Core.Test.ImportList
|
||||
.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 @@ namespace NzbDrone.Core.Test.ImportList
|
||||
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 @@ namespace NzbDrone.Core.Test.ImportList
|
||||
private void GivenNoListSync()
|
||||
{
|
||||
_importListFetch.SyncedLists = new List<int>();
|
||||
_importListFetch.SyncedWithoutFailure = new List<int>();
|
||||
}
|
||||
|
||||
private void GivenCleanLevel(string cleanLevel)
|
||||
@@ -114,6 +123,9 @@ namespace NzbDrone.Core.Test.ImportList
|
||||
{
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user