diff --git a/docs/Changelog.md b/docs/Changelog.md index 4188e33..f6d79f3 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -10,6 +10,7 @@ - Fix crash choosing Matroska edition in the menu. - Fix auto-play not working with user scripts. - Fix slow startup using osd-scale-by-window=no. +- Fix chapter time display in menu. - libmpv shinchiro 2022-05-17 with idle fix diff --git a/src/Misc/MainForm.cs b/src/Misc/MainForm.cs index 83dbeb8..fefbb41 100644 --- a/src/Misc/MainForm.cs +++ b/src/Misc/MainForm.cs @@ -301,8 +301,13 @@ namespace mpvnet foreach (var pair in Core.Chapters) { + string caption = TimeSpan.FromSeconds(pair.Value).ToString(); + + if (caption.ContainsEx(".")) + caption = caption.Substring(0, caption.LastIndexOf(".")); + var chapterMenuItem = new WpfControls.MenuItem() { Header = pair.Key }; - chapterMenuItem.InputGestureText = TimeSpan.FromSeconds(pair.Value).ToString().Substring(0, 8); + chapterMenuItem.InputGestureText = caption; chapterMenuItem.Click += (sender, args) => Core.CommandV("seek", pair.Value.ToString(CultureInfo.InvariantCulture), "absolute"); chaptersMenuItem.Items.Add(chapterMenuItem); }