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
|
||||||
{
|
{
|
||||||
|
@ -114,11 +115,9 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
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