BatchGuy.App.Eac3To.Services.RemuxTemplate2EAC3ToOutputNamingService.GetChapterName C# (CSharp) Метод

GetChapterName() публичный Метод

public GetChapterName ( EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName ) : string
eac3toConfiguration BatchGuy.App.Eac3to.Models.EAC3ToConfiguration
filesOutputPath string
paddedEpisodeNumber string
episodeName string
Результат string
        public override string GetChapterName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
        {
            StringBuilder sb = new StringBuilder();
            if (eac3toConfiguration.IsExtractForRemux == true)
            {
                string chapterName = string.Format("{0}, {1}E{2}{3}", eac3toConfiguration.RemuxFileNameTemplate.SeriesName, this.GetFormattedSeasonNumber(eac3toConfiguration),
                    this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber), this.GetFormattedYear(eac3toConfiguration));

                sb.Append(string.Format("\"{0}\\{1} chapters.txt\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, chapterName.Trim().RemoveDoubleSpaces())));
            }
            return sb.ToString();
        }

Usage Example

 public void remuxTemplate2EAC3ToOutputNamingService_can_set_chapter_name_no_season_year_test()
 {
     //given not extract for remux
     EAC3ToConfiguration config = new EAC3ToConfiguration()
     {
         IsExtractForRemux = true,
         RemuxFileNameTemplate = new EAC3ToRemuxFileNameTemplate()
         {
             AudioType = "FLAC 5.1",
             SeriesName = "BatchGuy",
             SeasonNumber = "2",
             Tag = "Guy",
             VideoResolution = "1080p",
             Medium = "Remux"
         }
     };
     string filesOutputPath = "c:\\bluray";
     string paddedEpisodeNumber = "01";
     string episodeName = string.Empty;
     //when i get the chapter name
     IAudioService audioService = new AudioService();
     AbstractEAC3ToOutputNamingService service = new RemuxTemplate2EAC3ToOutputNamingService(audioService);
     string chapterName = service.GetChapterName(config, filesOutputPath, paddedEpisodeNumber, episodeName);
     //then chapter name should be based on the remux template
     chapterName.Should().Be("\"c:\\bluray\\BatchGuy, S02E01 chapters.txt\"");
 }