#442 show chapters in the command palette
This commit is contained in:
@@ -261,6 +261,13 @@ namespace mpvnet
|
||||
Action = action;
|
||||
}
|
||||
|
||||
public CommandPaletteItem(string text, string secondaryText, Action action)
|
||||
{
|
||||
Text = text;
|
||||
Action = action;
|
||||
SecondaryText = secondaryText;
|
||||
}
|
||||
|
||||
public string Text { get; set; } = "";
|
||||
public string SecondaryText { get; set; } = "";
|
||||
public Action Action { get; set; }
|
||||
@@ -283,4 +290,26 @@ namespace mpvnet
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Chapter
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public double Time { get; set; }
|
||||
|
||||
string _TimeDisplay;
|
||||
|
||||
public string TimeDisplay {
|
||||
get {
|
||||
if (_TimeDisplay == null)
|
||||
{
|
||||
_TimeDisplay = TimeSpan.FromSeconds(Time).ToString();
|
||||
|
||||
if (_TimeDisplay.ContainsEx("."))
|
||||
_TimeDisplay = _TimeDisplay.Substring(0, _TimeDisplay.LastIndexOf("."));
|
||||
}
|
||||
|
||||
return _TimeDisplay;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user