|
|
|
@ -10,6 +10,7 @@ using NzbDrone.Common.Http;
|
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
|
using NzbDrone.Core.Extras.Files;
|
|
|
|
|
using NzbDrone.Core.Extras.Metadata.Files;
|
|
|
|
|
using NzbDrone.Core.Extras.Others;
|
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
|
|
|
@ -20,6 +21,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
private readonly IMetadataFactory _metadataFactory;
|
|
|
|
|
private readonly ICleanMetadataService _cleanMetadataService;
|
|
|
|
|
private readonly IRecycleBinProvider _recycleBinProvider;
|
|
|
|
|
private readonly IOtherExtraFileRenamer _otherExtraFileRenamer;
|
|
|
|
|
private readonly IDiskTransferService _diskTransferService;
|
|
|
|
|
private readonly IDiskProvider _diskProvider;
|
|
|
|
|
private readonly IHttpClient _httpClient;
|
|
|
|
@ -31,6 +33,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
IDiskProvider diskProvider,
|
|
|
|
|
IDiskTransferService diskTransferService,
|
|
|
|
|
IRecycleBinProvider recycleBinProvider,
|
|
|
|
|
IOtherExtraFileRenamer otherExtraFileRenamer,
|
|
|
|
|
IMetadataFactory metadataFactory,
|
|
|
|
|
ICleanMetadataService cleanMetadataService,
|
|
|
|
|
IHttpClient httpClient,
|
|
|
|
@ -41,6 +44,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
{
|
|
|
|
|
_metadataFactory = metadataFactory;
|
|
|
|
|
_cleanMetadataService = cleanMetadataService;
|
|
|
|
|
_otherExtraFileRenamer = otherExtraFileRenamer;
|
|
|
|
|
_recycleBinProvider = recycleBinProvider;
|
|
|
|
|
_diskTransferService = diskTransferService;
|
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
@ -91,7 +95,6 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
|
|
|
|
|
foreach (var consumer in _metadataFactory.Enabled())
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
files.AddIfNotNull(ProcessEpisodeMetadata(consumer, series, episodeFile, new List<MetadataFile>()));
|
|
|
|
|
files.AddRange(ProcessEpisodeImages(consumer, series, episodeFile, new List<MetadataFile>()));
|
|
|
|
|
}
|
|
|
|
@ -238,6 +241,8 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
|
|
|
|
|
var fullPath = Path.Combine(series.Path, episodeMetadata.RelativePath);
|
|
|
|
|
|
|
|
|
|
_otherExtraFileRenamer.RenameOtherExtraFile(series, fullPath);
|
|
|
|
|
|
|
|
|
|
var existingMetadata = GetMetadataFile(series, existingMetadataFiles, c => c.Type == MetadataType.EpisodeMetadata &&
|
|
|
|
|
c.EpisodeFileId == episodeFile.Id);
|
|
|
|
|
|
|
|
|
@ -292,6 +297,8 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_otherExtraFileRenamer.RenameOtherExtraFile(series, fullPath);
|
|
|
|
|
|
|
|
|
|
var metadata = GetMetadataFile(series, existingMetadataFiles, c => c.Type == MetadataType.SeriesImage &&
|
|
|
|
|
c.RelativePath == image.RelativePath) ??
|
|
|
|
|
new MetadataFile
|
|
|
|
@ -327,6 +334,8 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_otherExtraFileRenamer.RenameOtherExtraFile(series, fullPath);
|
|
|
|
|
|
|
|
|
|
var metadata = GetMetadataFile(series, existingMetadataFiles, c => c.Type == MetadataType.SeasonImage &&
|
|
|
|
|
c.SeasonNumber == season.SeasonNumber &&
|
|
|
|
|
c.RelativePath == image.RelativePath) ??
|
|
|
|
@ -363,6 +372,8 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_otherExtraFileRenamer.RenameOtherExtraFile(series, fullPath);
|
|
|
|
|
|
|
|
|
|
var existingMetadata = GetMetadataFile(series, existingMetadataFiles, c => c.Type == MetadataType.EpisodeImage &&
|
|
|
|
|
c.EpisodeFileId == episodeFile.Id);
|
|
|
|
|
|
|
|
|
|