mirror of https://github.com/Radarr/Radarr
Fix custom formats with indexer flags in queue
This commit is contained in:
parent
18f22d7ada
commit
f0fcd23248
|
@ -13,6 +13,7 @@ using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Core.Movies;
|
using NzbDrone.Core.Movies;
|
||||||
using NzbDrone.Core.Movies.Events;
|
using NzbDrone.Core.Movies.Events;
|
||||||
using NzbDrone.Core.Parser;
|
using NzbDrone.Core.Parser;
|
||||||
|
using NzbDrone.Core.Parser.Model;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Download.TrackedDownloads
|
namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
{
|
{
|
||||||
|
@ -116,9 +117,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
var historyItems = _historyService.FindByDownloadId(downloadItem.DownloadId)
|
var historyItems = _historyService.FindByDownloadId(downloadItem.DownloadId)
|
||||||
.OrderByDescending(h => h.Date)
|
.OrderByDescending(h => h.Date)
|
||||||
.ToList();
|
.ToList();
|
||||||
var grabbedHistoryItem = historyItems.FirstOrDefault(h => h.EventType == MovieHistoryEventType.Grabbed);
|
|
||||||
|
|
||||||
// TODO: Create release info from history and use that here, so we don't loose indexer flags!
|
|
||||||
var parsedMovieInfo = Parser.Parser.ParseMovieTitle(trackedDownload.DownloadItem.Title);
|
var parsedMovieInfo = Parser.Parser.ParseMovieTitle(trackedDownload.DownloadItem.Title);
|
||||||
|
|
||||||
if (parsedMovieInfo != null)
|
if (parsedMovieInfo != null)
|
||||||
|
@ -155,6 +154,13 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
firstHistoryItem.MovieId);
|
firstHistoryItem.MovieId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trackedDownload.RemoteMovie != null &&
|
||||||
|
Enum.TryParse(grabbedEvent?.Data?.GetValueOrDefault("indexerFlags"), true, out IndexerFlags flags))
|
||||||
|
{
|
||||||
|
trackedDownload.RemoteMovie.Release ??= new ReleaseInfo();
|
||||||
|
trackedDownload.RemoteMovie.Release.IndexerFlags = flags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate custom formats
|
// Calculate custom formats
|
||||||
|
|
Loading…
Reference in New Issue