diff --git a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs index 0ca268907..cb05ec205 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/MediaInfo/UpdateMediaInfoServiceFixture.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using FizzWare.NBuilder; using Moq; using NUnit.Framework; @@ -60,7 +60,7 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo .All() .With(v => v.RelativePath = "media.flac") .TheFirst(1) - .With(v => v.MediaInfo = new MediaInfoModel { SchemaRevision = UpdateMediaInfoService.CURRENT_MEDIA_INFO_SCHEMA_REVISION }) + .With(v => v.MediaInfo = new MediaInfoModel { SchemaRevision = VideoFileInfoReader.CURRENT_MEDIA_INFO_SCHEMA_REVISION }) .BuildList(); Mocker.GetMock() @@ -86,7 +86,7 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo .All() .With(v => v.RelativePath = "media.flac") .TheFirst(1) - .With(v => v.MediaInfo = new MediaInfoModel { SchemaRevision = UpdateMediaInfoService.MINIMUM_MEDIA_INFO_SCHEMA_REVISION }) + .With(v => v.MediaInfo = new MediaInfoModel { SchemaRevision = VideoFileInfoReader.MINIMUM_MEDIA_INFO_SCHEMA_REVISION }) .BuildList(); Mocker.GetMock() @@ -181,4 +181,4 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo .Verify(v => v.Update(It.IsAny()), Times.Exactly(1)); } } -} \ No newline at end of file +} diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/UpdateMediaInfoService.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/UpdateMediaInfoService.cs index 61e46abb3..a12690b05 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/UpdateMediaInfoService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/UpdateMediaInfoService.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using NLog; using NzbDrone.Common.Disk; using NzbDrone.Core.MediaFiles.Events; @@ -18,9 +18,6 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo private readonly IConfigService _configService; 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, IMediaFileService mediaFileService, IVideoFileInfoReader videoFileInfoReader, @@ -50,7 +47,6 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo if (mediaFile.MediaInfo != null) { - mediaFile.MediaInfo.SchemaRevision = CURRENT_MEDIA_INFO_SCHEMA_REVISION; _mediaFileService.Update(mediaFile); _logger.Debug("Updated MediaInfo for '{0}'", path); } @@ -66,9 +62,9 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo } 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); } } -} \ No newline at end of file +} diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index bca9310b6..2a06b2d57 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -17,6 +17,8 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo private readonly IDiskProvider _diskProvider; private readonly Logger _logger; + public const int MINIMUM_MEDIA_INFO_SCHEMA_REVISION = 3; + public const int CURRENT_MEDIA_INFO_SCHEMA_REVISION = 4; public VideoFileInfoReader(IDiskProvider diskProvider, Logger logger) { @@ -146,7 +148,8 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo VideoFps = videoFrameRate, AudioLanguages = audioLanguages, Subtitles = subtitles, - ScanType = scanType + ScanType = scanType, + SchemaRevision = CURRENT_MEDIA_INFO_SCHEMA_REVISION }; return mediaInfoModel;