1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-17 10:45:49 +02:00

Don't read media info when disabled in settings

Fixed: Don't read media info for existing files if "Analyse video files" disabled
Fixes #2549
This commit is contained in:
Mark McDowall 2018-05-09 13:38:05 -07:00
parent c687f45ff6
commit 2b3d0235cf

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation.Aggregators;
using NzbDrone.Core.MediaFiles.MediaInfo;
using NzbDrone.Core.Parser.Model;
@ -19,16 +20,19 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation
private readonly IEnumerable<IAggregateLocalEpisode> _augmenters;
private readonly IDiskProvider _diskProvider;
private readonly IVideoFileInfoReader _videoFileInfoReader;
private readonly IConfigService _configService;
private readonly Logger _logger;
public AugmentingService(IEnumerable<IAggregateLocalEpisode> augmenters,
IDiskProvider diskProvider,
IVideoFileInfoReader videoFileInfoReader,
IConfigService configService,
Logger logger)
{
_augmenters = augmenters;
_diskProvider = diskProvider;
_videoFileInfoReader = videoFileInfoReader;
_configService = configService;
_logger = logger;
}
@ -45,7 +49,11 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Aggregation
}
localEpisode.Size = _diskProvider.GetFileSize(localEpisode.Path);
localEpisode.MediaInfo = _videoFileInfoReader.GetMediaInfo(localEpisode.Path);
if (!localEpisode.ExistingFile || _configService.EnableMediaInfo)
{
localEpisode.MediaInfo = _videoFileInfoReader.GetMediaInfo(localEpisode.Path);
}
foreach (var augmenter in _augmenters)
{