Fixed some mediainfo subtitle codes
This commit is contained in:
parent
7ee7e1be5d
commit
95071c9d97
|
@ -526,6 +526,27 @@ namespace NzbDrone.Core.Test.OrganizerTests.FileNameBuilderTests
|
||||||
.Should().Be("South.Park.S15E06.City.Sushi.X264.DTS[EN+ES].[EN+ES+IT]");
|
.Should().Be("South.Park.S15E06.City.Sushi.X264.DTS[EN+ES].[EN+ES+IT]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase("Norwegian Bokmal", "NB")]
|
||||||
|
[TestCase("Swedis", "SV")]
|
||||||
|
[TestCase("Chinese", "ZH")]
|
||||||
|
public void should_format_languagecodes_properly(string language, string code)
|
||||||
|
{
|
||||||
|
_namingConfig.StandardEpisodeFormat = "{Series.Title}.S{season:00}E{episode:00}.{Episode.Title}.{MEDIAINFO.FULL}";
|
||||||
|
|
||||||
|
_episodeFile.MediaInfo = new Core.MediaFiles.MediaInfo.MediaInfoModel()
|
||||||
|
{
|
||||||
|
VideoCodec = "AVC",
|
||||||
|
AudioFormat = "DTS",
|
||||||
|
AudioChannels = 6,
|
||||||
|
AudioLanguages = "English",
|
||||||
|
Subtitles = language,
|
||||||
|
SchemaRevision = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
Subject.BuildFileName(new List<Episode> { _episode1 }, _series, _episodeFile)
|
||||||
|
.Should().Be($"South.Park.S15E06.City.Sushi.X264.DTS.[{code}]");
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_exclude_english_in_mediainfo_audio_language()
|
public void should_exclude_english_in_mediainfo_audio_language()
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,6 +13,7 @@ using NzbDrone.Common.EnvironmentInfo;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.MediaFiles.MediaInfo;
|
using NzbDrone.Core.MediaFiles.MediaInfo;
|
||||||
|
using NzbDrone.Core.Parser;
|
||||||
using NzbDrone.Core.Profiles.Releases;
|
using NzbDrone.Core.Profiles.Releases;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
|
@ -671,9 +672,23 @@ namespace NzbDrone.Core.Organizer
|
||||||
var cultures = CultureInfo.GetCultures(CultureTypes.NeutralCultures);
|
var cultures = CultureInfo.GetCultures(CultureTypes.NeutralCultures);
|
||||||
for (int i = 0; i < tokens.Count; i++)
|
for (int i = 0; i < tokens.Count; i++)
|
||||||
{
|
{
|
||||||
|
if (tokens[i] == "Swedis")
|
||||||
|
{
|
||||||
|
// Probably typo in mediainfo (should be 'Swedish')
|
||||||
|
tokens[i] = "SV";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tokens[i] == "Chinese" && OsInfo.IsNotWindows)
|
||||||
|
{
|
||||||
|
// Mono only has 'Chinese (Simplified)' & 'Chinese (Traditional)'
|
||||||
|
tokens[i] = "ZH";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var cultureInfo = cultures.FirstOrDefault(p => p.EnglishName == tokens[i]);
|
var cultureInfo = cultures.FirstOrDefault(p => p.EnglishName.RemoveAccent() == tokens[i]);
|
||||||
|
|
||||||
if (cultureInfo != null)
|
if (cultureInfo != null)
|
||||||
tokens[i] = cultureInfo.TwoLetterISOLanguageName.ToUpper();
|
tokens[i] = cultureInfo.TwoLetterISOLanguageName.ToUpper();
|
||||||
|
|
Loading…
Reference in New Issue