mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
Fixed: Errors logged during import when existing episode file is partial removed in the DB
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
+13
@@ -224,5 +224,18 @@ namespace NzbDrone.Core.Test.MediaFiles.TrackImport.Specifications
|
||||
|
||||
Subject.IsSatisfiedBy(_localTrack).Accepted.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_if_track_file_is_null()
|
||||
{
|
||||
_localTrack.Tracks = Builder<Track>.CreateListOfSize(2)
|
||||
.All()
|
||||
.With(e => e.TrackFileId = 1)
|
||||
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(null))
|
||||
.Build()
|
||||
.ToList();
|
||||
|
||||
Subject.IsSatisfiedBy(_localTrack).Accepted.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,5 +181,20 @@ namespace NzbDrone.Core.Test.MediaFiles
|
||||
|
||||
Subject.UpgradeTrackFile(_trackFile, _localTrack).OldFiles.Count.Should().Be(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_import_if_existing_file_doesnt_exist_in_db()
|
||||
{
|
||||
_localTrack.Tracks = Builder<Track>.CreateListOfSize(1)
|
||||
.All()
|
||||
.With(e => e.TrackFileId = 1)
|
||||
.With(e => e.TrackFile = new LazyLoaded<TrackFile>(null))
|
||||
.Build()
|
||||
.ToList();
|
||||
|
||||
Subject.UpgradeTrackFile(_trackFile, _localTrack);
|
||||
|
||||
Mocker.GetMock<IMediaFileService>().Verify(v => v.Delete(_localTrack.Tracks.Single().TrackFile.Value, It.IsAny<DeleteMediaFileReason>()), Times.Never());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user