mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-17 21:25:39 -04:00
Compare commits
1 Commits
v0.3.30.25
...
sonarr-pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a03a2197b |
@@ -46,7 +46,6 @@ namespace NzbDrone.Core.Test.QueueTests
|
|||||||
|
|
||||||
_trackedDownloads = Builder<TrackedDownload>.CreateListOfSize(1)
|
_trackedDownloads = Builder<TrackedDownload>.CreateListOfSize(1)
|
||||||
.All()
|
.All()
|
||||||
.With(v => v.IsTrackable = true)
|
|
||||||
.With(v => v.DownloadItem = downloadItem)
|
.With(v => v.DownloadItem = downloadItem)
|
||||||
.With(v => v.RemoteBook = remoteBook)
|
.With(v => v.RemoteBook = remoteBook)
|
||||||
.Build()
|
.Build()
|
||||||
|
|||||||
@@ -1,18 +1,26 @@
|
|||||||
using NzbDrone.Core.Instrumentation;
|
using NzbDrone.Core.Configuration;
|
||||||
|
using NzbDrone.Core.Instrumentation;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
||||||
{
|
{
|
||||||
public class TrimLogDatabase : IHousekeepingTask
|
public class TrimLogDatabase : IHousekeepingTask
|
||||||
{
|
{
|
||||||
private readonly ILogRepository _logRepo;
|
private readonly ILogRepository _logRepo;
|
||||||
|
private readonly IConfigFileProvider _configFileProvider;
|
||||||
|
|
||||||
public TrimLogDatabase(ILogRepository logRepo)
|
public TrimLogDatabase(ILogRepository logRepo, IConfigFileProvider configFileProvider)
|
||||||
{
|
{
|
||||||
_logRepo = logRepo;
|
_logRepo = logRepo;
|
||||||
|
_configFileProvider = configFileProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clean()
|
public void Clean()
|
||||||
{
|
{
|
||||||
|
if (!_configFileProvider.LogDbEnabled)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_logRepo.Trim();
|
_logRepo.Trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace NzbDrone.Core.Queue
|
|||||||
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
|
public class QueueService : IQueueService, IHandle<TrackedDownloadRefreshedEvent>
|
||||||
{
|
{
|
||||||
private readonly IEventAggregator _eventAggregator;
|
private readonly IEventAggregator _eventAggregator;
|
||||||
private static List<Queue> _queue = new ();
|
private static List<Queue> _queue = new List<Queue>();
|
||||||
private readonly IHistoryService _historyService;
|
private readonly IHistoryService _historyService;
|
||||||
|
|
||||||
public QueueService(IEventAggregator eventAggregator,
|
public QueueService(IEventAggregator eventAggregator,
|
||||||
@@ -105,11 +105,8 @@ namespace NzbDrone.Core.Queue
|
|||||||
|
|
||||||
public void Handle(TrackedDownloadRefreshedEvent message)
|
public void Handle(TrackedDownloadRefreshedEvent message)
|
||||||
{
|
{
|
||||||
_queue = message.TrackedDownloads
|
_queue = message.TrackedDownloads.OrderBy(c => c.DownloadItem.RemainingTime).SelectMany(MapQueue)
|
||||||
.Where(t => t.IsTrackable)
|
.ToList();
|
||||||
.OrderBy(c => c.DownloadItem.RemainingTime)
|
|
||||||
.SelectMany(MapQueue)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new QueueUpdatedEvent());
|
_eventAggregator.PublishEvent(new QueueUpdatedEvent());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user