|
|
@ -1,4 +1,4 @@
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common.Disk;
|
|
|
|
using NzbDrone.Common.Disk;
|
|
|
|
using NzbDrone.Core.MediaFiles.Events;
|
|
|
|
using NzbDrone.Core.MediaFiles.Events;
|
|
|
@ -18,9 +18,6 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
private readonly IConfigService _configService;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
|
|
public const int MINIMUM_MEDIA_INFO_SCHEMA_REVISION = 3;
|
|
|
|
|
|
|
|
public const int CURRENT_MEDIA_INFO_SCHEMA_REVISION = 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UpdateMediaInfoService(IDiskProvider diskProvider,
|
|
|
|
public UpdateMediaInfoService(IDiskProvider diskProvider,
|
|
|
|
IMediaFileService mediaFileService,
|
|
|
|
IMediaFileService mediaFileService,
|
|
|
|
IVideoFileInfoReader videoFileInfoReader,
|
|
|
|
IVideoFileInfoReader videoFileInfoReader,
|
|
|
@ -50,7 +47,6 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
|
|
|
|
|
|
|
|
|
|
|
|
if (mediaFile.MediaInfo != null)
|
|
|
|
if (mediaFile.MediaInfo != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mediaFile.MediaInfo.SchemaRevision = CURRENT_MEDIA_INFO_SCHEMA_REVISION;
|
|
|
|
|
|
|
|
_mediaFileService.Update(mediaFile);
|
|
|
|
_mediaFileService.Update(mediaFile);
|
|
|
|
_logger.Debug("Updated MediaInfo for '{0}'", path);
|
|
|
|
_logger.Debug("Updated MediaInfo for '{0}'", path);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -66,7 +62,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var allMediaFiles = _mediaFileService.GetFilesByArtist(message.Artist.Id);
|
|
|
|
var allMediaFiles = _mediaFileService.GetFilesByArtist(message.Artist.Id);
|
|
|
|
var filteredMediaFiles = allMediaFiles.Where(c => c.MediaInfo == null || c.MediaInfo.SchemaRevision < MINIMUM_MEDIA_INFO_SCHEMA_REVISION).ToList();
|
|
|
|
var filteredMediaFiles = allMediaFiles.Where(c => c.MediaInfo == null || c.MediaInfo.SchemaRevision < VideoFileInfoReader.MINIMUM_MEDIA_INFO_SCHEMA_REVISION).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
UpdateMediaInfo(message.Artist, filteredMediaFiles);
|
|
|
|
UpdateMediaInfo(message.Artist, filteredMediaFiles);
|
|
|
|
}
|
|
|
|
}
|
|
|
|