#423 Fix chapter time display in menu
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user