public GetSubtitleName ( |
||
eac3toConfiguration | ||
subtitle | ||
filesOutputPath | string | |
paddedEpisodeNumber | string | |
episodeName | string | |
Результат | string |
public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
{
StringBuilder sb = new StringBuilder();
if (eac3toConfiguration.IsExtractForRemux == true)
{
string tag = this.GetFormattedTag(eac3toConfiguration, paddedEpisodeNumber, episodeName);
string subtitleName = string.Format("{0}{1}{2}E{3}{4}{5}{6}{7}{8}{9}",
eac3toConfiguration.RemuxFileNameTemplate.SeriesName,
this.GetFormattedYear(eac3toConfiguration),
this.GetFormattedSeasonNumber(eac3toConfiguration),
this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber),
this.GetFormattedEpisodeName(episodeName),
this.GetFormattedVideoResolution(eac3toConfiguration),
this.GetFormattedCountry(eac3toConfiguration),
this.GetFormattedMedium(eac3toConfiguration),
this.GetFormattedVideoFormat(eac3toConfiguration),
this.GetFormattedAuditoType(eac3toConfiguration));
sb.Append(string.Format("\"{0}\\{1}{2} {3}{4}-{5}{6}.sup\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, subtitleName.Trim().RemoveDoubleSpaces()), tag, subtitle.Language, paddedEpisodeNumber, subtitle.Id.RemoveColons(), this.GetSubtitleCommentary(subtitle)));
}
return sb.ToString();
}
public void remuxTemplate1EAC3ToOutputNamingService_can_set_subtitle_name_when_is_commentary_and_only_required_test() { //given not extract for remux EAC3ToConfiguration config = new EAC3ToConfiguration() { IsExtractForRemux = true, RemuxFileNameTemplate = new EAC3ToRemuxFileNameTemplate() { SeriesName = "BatchGuy", SeasonNumber = "2", } }; string filesOutputPath = "c:\\bluray"; string paddedEpisodeNumber = "01"; string episodeName = string.Empty; //when i get the subtitle name IAudioService audioService = new AudioService(); AbstractEAC3ToOutputNamingService service = new RemuxTemplate1EAC3ToOutputNamingService(audioService); BluRayTitleSubtitle subtitle = new BluRayTitleSubtitle() { Id = "3:", Language = "english", IsCommentary = true }; string subtitleName = service.GetSubtitleName(config, subtitle, filesOutputPath, paddedEpisodeNumber, episodeName); //then subtitle name should be based on the remux template and commentary subtitleName.Should().Be("\"c:\\bluray\\BatchGuy S02E01 english01-3-commentary.sup\""); }