private static Chapter CreateDefaultChapter(Chapter chapter) { return new Chapter(chapter.Number, chapter.StartTime.TotalSeconds) { Title = null, Language = chapter.Language }; }
private ListViewItem ToListItem(Chapter chapter) { var item = new ListViewItem(chapter.Title) { Tag = chapter, Checked = chapter.Keep }; var subitems = new[] { new ListViewItem.ListViewSubItem(item, chapter.StartTime.ToStringMedium()) { Tag = chapter.StartTime }, new ListViewItem.ListViewSubItem(item, chapter.Number.ToString("D")) { Tag = chapter.Number } }; item.SubItems.AddRange(subitems); return item; }
private static string GetChapterDupKey(Chapter chapter) { return string.Format("{0}/{1}", chapter.Number, chapter.StartTime); }
private static Chapter Transform(JsonChapter jsonChapter, int i) { var title = (jsonChapter.name ?? "").Trim(); var isValidChapterName = IsValidChapterName(title); var chapter = new Chapter(i + 1, jsonChapter.time.TotalSeconds) { Title = title, Keep = isValidChapterName }; return chapter; }