|
|
@ -2,6 +2,7 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Lifecycle;
|
|
|
|
using NzbDrone.Core.Lifecycle;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.Update.History.Events;
|
|
|
|
using NzbDrone.Core.Update.History.Events;
|
|
|
@ -18,13 +19,15 @@ namespace NzbDrone.Core.Update.History
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly IUpdateHistoryRepository _repository;
|
|
|
|
private readonly IUpdateHistoryRepository _repository;
|
|
|
|
private readonly IEventAggregator _eventAggregator;
|
|
|
|
private readonly IEventAggregator _eventAggregator;
|
|
|
|
|
|
|
|
private readonly IConfigFileProvider _configFileProvider;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private Version _prevVersion;
|
|
|
|
private Version _prevVersion;
|
|
|
|
|
|
|
|
|
|
|
|
public UpdateHistoryService(IUpdateHistoryRepository repository, IEventAggregator eventAggregator, Logger logger)
|
|
|
|
public UpdateHistoryService(IUpdateHistoryRepository repository, IEventAggregator eventAggregator, IConfigFileProvider configFileProvider, Logger logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_repository = repository;
|
|
|
|
_repository = repository;
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
|
|
|
|
_configFileProvider = configFileProvider;
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -58,7 +61,7 @@ namespace NzbDrone.Core.Update.History
|
|
|
|
|
|
|
|
|
|
|
|
public void Handle(ApplicationStartedEvent message)
|
|
|
|
public void Handle(ApplicationStartedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (BuildInfo.Version.Major == 10)
|
|
|
|
if (BuildInfo.Version.Major == 10 || !_configFileProvider.LogDbEnabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Don't save dev versions, they change constantly
|
|
|
|
// Don't save dev versions, they change constantly
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|