auto-load-folder threading stability

This commit is contained in:
stax76
2022-05-22 15:49:25 +02:00
parent e8baa21d42
commit 6fc546c69c
3 changed files with 1 additions and 13 deletions

View File

@@ -238,9 +238,6 @@ Shows a file browser dialog to open external subtitle files.
Opens the config folder with Windows File Explorer. Opens the config folder with Windows File Explorer.
### open-files [\<flags\>] ### open-files [\<flags\>]
**no-folder**
For single files prevents loading the complete folder into the playlist.
**append** **append**
Appends files to the playlist. Appends files to the playlist.

View File

@@ -90,21 +90,15 @@ namespace mpvnet
public static void OpenFiles(params string[] args) public static void OpenFiles(params string[] args)
{ {
bool append = Control.ModifierKeys.HasFlag(Keys.Control); bool append = Control.ModifierKeys.HasFlag(Keys.Control);
bool loadFolder = true;
foreach (string arg in args) foreach (string arg in args)
{
if (arg == "append") if (arg == "append")
append = true; append = true;
if (arg == "no-folder")
loadFolder = false;
}
App.InvokeOnMainThread(new Action(() => { App.InvokeOnMainThread(new Action(() => {
using (var d = new OpenFileDialog() { Multiselect = true }) using (var d = new OpenFileDialog() { Multiselect = true })
if (d.ShowDialog() == DialogResult.OK) if (d.ShowDialog() == DialogResult.OK)
Core.LoadFiles(d.FileNames, loadFolder, append); Core.LoadFiles(d.FileNames, true, append);
})); }));
} }

View File

@@ -1156,9 +1156,6 @@ namespace mpvnet
if (string.IsNullOrEmpty(GetPropertyString("path"))) if (string.IsNullOrEmpty(GetPropertyString("path")))
SetPropertyInt("playlist-pos", 0); SetPropertyInt("playlist-pos", 0);
if (loadFolder && !append)
App.RunTask(() => LoadFolder());
} }
public void LoadISO(string path) public void LoadISO(string path)