1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-25 01:02:05 +00:00

Fixed: Allow repeated import attempts until downloaded files appear

This commit is contained in:
ta264 2021-08-04 21:26:09 +01:00
parent f7925ff5d6
commit 9f1d4446e8
2 changed files with 2 additions and 10 deletions

View file

@ -167,7 +167,7 @@ public void should_not_mark_as_failed_if_nothing_found_to_import()
Subject.Import(_trackedDownload);
_trackedDownload.State.Should().Be(TrackedDownloadState.Importing);
_trackedDownload.State.Should().Be(TrackedDownloadState.ImportPending);
}
[Test]

View file

@ -109,6 +109,7 @@ public void Import(TrackedDownload trackedDownload)
if (importResults.Empty())
{
trackedDownload.Warn("No files found are eligible for import in {0}", outputPath);
trackedDownload.State = TrackedDownloadState.ImportPending;
return;
}
@ -116,10 +117,6 @@ public void Import(TrackedDownload trackedDownload)
importResults.Count(c => c.Result == ImportResultType.Imported) >=
Math.Max(1, trackedDownload.RemoteAlbum.Albums.Sum(x => x.AlbumReleases.Value.Where(y => y.Monitored).Sum(z => z.TrackCount)));
Console.WriteLine($"allimported: {allTracksImported}");
Console.WriteLine($"count: {importResults.Count(c => c.Result == ImportResultType.Imported)}");
Console.WriteLine($"max: {Math.Max(1, trackedDownload.RemoteAlbum.Albums.Sum(x => x.AlbumReleases.Value.Where(y => y.Monitored).Sum(z => z.TrackCount)))}");
if (allTracksImported)
{
trackedDownload.State = TrackedDownloadState.Imported;
@ -148,11 +145,6 @@ public void Import(TrackedDownload trackedDownload)
trackedDownload.State = TrackedDownloadState.ImportPending;
if (importResults.Empty())
{
trackedDownload.Warn("No files found are eligible for import in {0}", outputPath);
}
if (importResults.Any(c => c.Result != ImportResultType.Imported))
{
trackedDownload.State = TrackedDownloadState.ImportFailed;