Merge pull request #517 from Torben2000/feature/playlist-titles

Use item title in playlist command palette if set
This commit is contained in:
stax76
2023-01-21 08:12:56 +01:00
committed by GitHub

View File

@@ -546,13 +546,16 @@ namespace mpvnet
{ {
int index = i; int index = i;
string file = Core.GetPropertyString($"playlist/{i}/filename"); string file = Core.GetPropertyString($"playlist/{i}/filename");
string title = Core.GetPropertyString($"playlist/{i}/title");
CommandPaletteItem item = new CommandPaletteItem() CommandPaletteItem item = new CommandPaletteItem()
{ {
Text = file.FileName(), Text = title,
Action = () => Core.SetPropertyInt("playlist-pos", index) Action = () => Core.SetPropertyInt("playlist-pos", index)
}; };
if (string.IsNullOrEmpty(item.Text))
item.Text = file.FileName();
if (string.IsNullOrEmpty(item.Text)) if (string.IsNullOrEmpty(item.Text))
item.Text = file; item.Text = file;