mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Calculating custom formats for queue
This commit is contained in:
parent
98fa5bb1a3
commit
9375373668
1 changed files with 9 additions and 1 deletions
|
@ -6,6 +6,7 @@ using NzbDrone.Common.Cache;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Common.Serializer;
|
using NzbDrone.Common.Serializer;
|
||||||
using NzbDrone.Core.CustomFormats;
|
using NzbDrone.Core.CustomFormats;
|
||||||
|
using NzbDrone.Core.Download.Aggregation;
|
||||||
using NzbDrone.Core.Download.History;
|
using NzbDrone.Core.Download.History;
|
||||||
using NzbDrone.Core.History;
|
using NzbDrone.Core.History;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
|
@ -36,6 +37,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
private readonly IHistoryService _historyService;
|
private readonly IHistoryService _historyService;
|
||||||
private readonly IEventAggregator _eventAggregator;
|
private readonly IEventAggregator _eventAggregator;
|
||||||
private readonly IDownloadHistoryService _downloadHistoryService;
|
private readonly IDownloadHistoryService _downloadHistoryService;
|
||||||
|
private readonly IRemoteAlbumAggregationService _aggregationService;
|
||||||
private readonly ICustomFormatCalculationService _formatCalculator;
|
private readonly ICustomFormatCalculationService _formatCalculator;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
private readonly ICached<TrackedDownload> _cache;
|
private readonly ICached<TrackedDownload> _cache;
|
||||||
|
@ -46,6 +48,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
ICustomFormatCalculationService formatCalculator,
|
ICustomFormatCalculationService formatCalculator,
|
||||||
IEventAggregator eventAggregator,
|
IEventAggregator eventAggregator,
|
||||||
IDownloadHistoryService downloadHistoryService,
|
IDownloadHistoryService downloadHistoryService,
|
||||||
|
IRemoteAlbumAggregationService aggregationService,
|
||||||
Logger logger)
|
Logger logger)
|
||||||
{
|
{
|
||||||
_parsingService = parsingService;
|
_parsingService = parsingService;
|
||||||
|
@ -54,6 +57,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
_formatCalculator = formatCalculator;
|
_formatCalculator = formatCalculator;
|
||||||
_eventAggregator = eventAggregator;
|
_eventAggregator = eventAggregator;
|
||||||
_downloadHistoryService = downloadHistoryService;
|
_downloadHistoryService = downloadHistoryService;
|
||||||
|
_aggregationService = aggregationService;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +71,8 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
var parsedAlbumInfo = Parser.Parser.ParseAlbumTitle(trackedDownload.DownloadItem.Title);
|
var parsedAlbumInfo = Parser.Parser.ParseAlbumTitle(trackedDownload.DownloadItem.Title);
|
||||||
|
|
||||||
trackedDownload.RemoteAlbum = parsedAlbumInfo == null ? null : _parsingService.Map(parsedAlbumInfo);
|
trackedDownload.RemoteAlbum = parsedAlbumInfo == null ? null : _parsingService.Map(parsedAlbumInfo);
|
||||||
|
|
||||||
|
_aggregationService.Augment(trackedDownload.RemoteAlbum);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopTracking(string downloadId)
|
public void StopTracking(string downloadId)
|
||||||
|
@ -191,9 +197,11 @@ namespace NzbDrone.Core.Download.TrackedDownloads
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate custom formats
|
|
||||||
if (trackedDownload.RemoteAlbum != null)
|
if (trackedDownload.RemoteAlbum != null)
|
||||||
{
|
{
|
||||||
|
_aggregationService.Augment(trackedDownload.RemoteAlbum);
|
||||||
|
|
||||||
|
// Calculate custom formats
|
||||||
trackedDownload.RemoteAlbum.CustomFormats = _formatCalculator.ParseCustomFormat(trackedDownload.RemoteAlbum, downloadItem.TotalSize);
|
trackedDownload.RemoteAlbum.CustomFormats = _formatCalculator.ParseCustomFormat(trackedDownload.RemoteAlbum, downloadItem.TotalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue