New: Original Title can be used in file names

This commit is contained in:
Mark McDowall 2014-01-16 23:23:34 -08:00
parent 1e878a88fd
commit 7c6605c02b
4 changed files with 18 additions and 2 deletions

View File

@ -353,5 +353,18 @@ namespace NzbDrone.Core.Test.OrganizerTests
Subject.BuildFilename(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be(_episodeFile.ReleaseGroup);
}
[Test]
public void should_be_able_to_use_orginal_title()
{
_series.Title = "30 Rock";
_namingConfig.StandardEpisodeFormat = "{Series Title} - {Original Title}";
_episodeFile.SceneName = "30.Rock.S01E01.xvid-LOL";
_episodeFile.Path = @"C:\Test\TV\30 Rock - S01E01 - Test";
Subject.BuildFilename(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be("30 Rock - 30.Rock.S01E01.xvid-LOL");
}
}
}

View File

@ -5,7 +5,6 @@ using System.Linq;
using System.Text.RegularExpressions;
using NLog;
using NzbDrone.Common.Cache;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Tv;
@ -86,7 +85,8 @@ namespace NzbDrone.Core.Organizer
var tokenValues = new Dictionary<string, string>(FilenameBuilderTokenEqualityComparer.Instance)
{
{"{Series Title}", series.Title}
{"{Series Title}", series.Title},
{"Original Title", episodeFile.SceneName}
};
tokenValues.Add("{Release Group}", episodeFile.ReleaseGroup);

View File

@ -42,6 +42,7 @@
{{> EpisodeTitleNamingPartial}}
{{> QualityTitleNamingPartial}}
{{> ReleaseGroupNamingPartial}}
{{> OriginalTitleNamingPartial}}
{{> SeparatorNamingPartial}}
</ul>
</div>
@ -71,6 +72,7 @@
{{> EpisodeTitleNamingPartial}}
{{> QualityTitleNamingPartial}}
{{> ReleaseGroupNamingPartial}}
{{> OriginalTitleNamingPartial}}
{{> SeparatorNamingPartial}}
</ul>
</div>

View File

@ -0,0 +1 @@
<li><a href="#" data-token="Original Title">Original Title</a></li>