Compare commits

..

1 commit

Author SHA1 Message Date
Brett Baker
9eaaf6c1cc
Merge 72eddfca6d into eb221c3e49 2024-11-02 11:38:19 +00:00

View file

@ -30,12 +30,9 @@ private MediaFormat ParseFormat(Format analysisFormat)
}; };
} }
private string GetValue(string tagName, Dictionary<string, string>? tags, string defaultValue) =>
tags == null ? defaultValue : tags.TryGetValue(tagName, out var value) ? value : defaultValue;
private ChapterData ParseChapter(Chapter analysisChapter) private ChapterData ParseChapter(Chapter analysisChapter)
{ {
var title = GetValue("title", analysisChapter.Tags, "TitleValueNotSet"); var title = analysisChapter.Tags.FirstOrDefault(t => t.Key == "title").Value;
var start = MediaAnalysisUtils.ParseDuration(analysisChapter.StartTime); var start = MediaAnalysisUtils.ParseDuration(analysisChapter.StartTime);
var end = MediaAnalysisUtils.ParseDuration(analysisChapter.EndTime); var end = MediaAnalysisUtils.ParseDuration(analysisChapter.EndTime);