public ErrorCollection Write() { if (this.IsValid()) { try { this.Delete(); foreach (BluRayDiscInfo disc in _bluRayDiscInfoList.Where(d => d.IsSelected)) { foreach (BluRaySummaryInfo summary in disc.BluRaySummaryInfoList.Where(s => s.IsSelected).OrderBy(s => s.EpisodeNumber)) { _eac3ToOutputNamingService.SetCurrentBluRaySummaryInfo(summary); IMKVMergeOutputService mkvMergeOutputService = new MKVMergeOutputService(_eac3toConfiguration, _eac3ToOutputNamingService, disc.BluRayPath, summary); string mkvMergePathPart = mkvMergeOutputService.GetMKVMergePathPart(); string mkvMergeOutputPart = mkvMergeOutputService.GetOutputPart(); string mkvMergeVideoPart = mkvMergeOutputService.GetVideoPart(); string mkvMergeAudioPart = mkvMergeOutputService.GetAudioPart(); string mkvMergeSubtitlePart = mkvMergeOutputService.GetSubtitlePart(); string mkvMergeChaptersPart = mkvMergeOutputService.GetChaptersPart(); string mkvMergeTrackOrderPart = mkvMergeOutputService.GetTrackOrderPart(); using (StreamWriter sw = new StreamWriter(_eac3toConfiguration.MKVMergeBatchFilePath, true)) { sw.WriteLine(string.Format("{0} {1} {2} {3} {4} {5} {6}", mkvMergePathPart, mkvMergeOutputPart, mkvMergeVideoPart, mkvMergeAudioPart, mkvMergeSubtitlePart, mkvMergeChaptersPart, mkvMergeTrackOrderPart)); sw.WriteLine(); sw.WriteLine(); } } } } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() { Description = "There was an error while creating the mkvmerge batch file." }); } } return(_errors); }
public ErrorCollection Write() { if (this.IsValid()) { try { this.Delete(); foreach (BluRayDiscInfo disc in _bluRayDiscInfoList.Where(d => d.IsSelected)) { foreach (BluRaySummaryInfo summary in disc.BluRaySummaryInfoList.Where(s => s.IsSelected).OrderBy(s => s.EpisodeNumber)) { IMKVMergeOutputService mkvMergeOutputService = new MKVMergeOutputService(_eac3toConfiguration, _eac3ToOutputNamingService, disc.BluRayPath, summary); string mkvMergePathPart = mkvMergeOutputService.GetMKVMergePathPart(); string mkvMergeOutputPart = mkvMergeOutputService.GetOutputPart(); string mkvMergeVideoPart = mkvMergeOutputService.GetVideoPart(); string mkvMergeAudioPart = mkvMergeOutputService.GetAudioPart(); string mkvMergeSubtitlePart = mkvMergeOutputService.GetSubtitlePart(); string mkvMergeChaptersPart = mkvMergeOutputService.GetChaptersPart(); string mkvMergeTrackOrderPart = mkvMergeOutputService.GetTrackOrderPart(); using (StreamWriter sw = new StreamWriter(_eac3toConfiguration.MKVMergeBatchFilePath, true)) { sw.WriteLine(string.Format("{0} {1} {2} {3} {4} {5} {6}", mkvMergePathPart, mkvMergeOutputPart, mkvMergeVideoPart, mkvMergeAudioPart, mkvMergeSubtitlePart, mkvMergeChaptersPart, mkvMergeTrackOrderPart)); sw.WriteLine(); sw.WriteLine(); } } } } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() { Description = "There was an error while creating the mkvmerge batch file." }); } } return _errors; }