1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00

Fixed: Not being able to use MediaInfo VideoDynamicRange token to renaming options.

This commit is contained in:
Taloth Saldono 2019-03-08 18:33:02 +01:00
parent 13c625d7c0
commit 02c64ad3a5
2 changed files with 19 additions and 0 deletions

View file

@ -770,6 +770,20 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
Mocker.GetMock<IUpdateMediaInfo>().Verify(v => v.Update(_episodeFile, _series), Times.Once()); Mocker.GetMock<IUpdateMediaInfo>().Verify(v => v.Update(_episodeFile, _series), Times.Once());
} }
[Test]
public void should_not_update_media_info_if_no_series_path_available()
{
_namingConfig.StandardEpisodeFormat =
"{Series.Title}.S{season:00}E{episode:00}.{Episode.Title}.{MediaInfo VideoDynamicRange}";
GivenMediaInfoModel(schemaRevision: 3);
_series.Path = null;
Subject.BuildFileName(new List<Episode> { _episode1 }, _series, _episodeFile);
Mocker.GetMock<IUpdateMediaInfo>().Verify(v => v.Update(_episodeFile, _series), Times.Never());
}
[Test] [Test]
public void should_not_update_media_info_if_token_not_configured_and_revision_is_old() public void should_not_update_media_info_if_token_not_configured_and_revision_is_old()
{ {

View file

@ -658,6 +658,11 @@ namespace NzbDrone.Core.Organizer
private void UpdateMediaInfoIfNeeded(string pattern, EpisodeFile episodeFile, Series series) private void UpdateMediaInfoIfNeeded(string pattern, EpisodeFile episodeFile, Series series)
{ {
if (series.Path.IsNullOrWhiteSpace())
{
return;
}
var schemaRevision = episodeFile.MediaInfo != null ? episodeFile.MediaInfo.SchemaRevision : 0; var schemaRevision = episodeFile.MediaInfo != null ? episodeFile.MediaInfo.SchemaRevision : 0;
var matches = TitleRegex.Matches(pattern); var matches = TitleRegex.Matches(pattern);