auto-load-folder threading stability
This commit is contained in:
@@ -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.
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user