BatchGuy.App.Eac3To.Services.MovieRemuxTemplate1EAC3ToOutputNamingService.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)
        {
            if (_currentMovieRemuxTemplate == null)
                throw new NullReferenceException("Current Movie Template is Null.");

            StringBuilder sb = new StringBuilder();
            if (eac3toConfiguration.IsExtractForRemux == true && eac3toConfiguration.IfIsExtractForRemuxIsItForAMovie)
            {
                string tag = this.GetFormattedTag(eac3toConfiguration, paddedEpisodeNumber);
                string chapterName = string.Format("{0}{1}{2}{3}{4}{5}{6}",
                    _currentMovieRemuxTemplate.SeriesName,
                    this.GetFormattedYear(eac3toConfiguration),
                    this.GetFormattedVideoResolution(eac3toConfiguration),
                    this.GetFormattedCountry(eac3toConfiguration),
                    this.GetFormattedMedium(eac3toConfiguration),
                    this.GetFormattedVideoFormat(eac3toConfiguration),
                    this.GetFormattedAuditoType(eac3toConfiguration));

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

Usage Example

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