New: Original Title can be used in file names

pull/2/head
Mark McDowall 11 years ago
parent 1e878a88fd
commit 7c6605c02b

@ -353,5 +353,18 @@ namespace NzbDrone.Core.Test.OrganizerTests
Subject.BuildFilename(new List<Episode> { _episode1 }, _series, _episodeFile) Subject.BuildFilename(new List<Episode> { _episode1 }, _series, _episodeFile)
.Should().Be(_episodeFile.ReleaseGroup); .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");
}
} }
} }

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

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

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