Fix auto-load-folder not working with user scripts

This commit is contained in:
stax76
2022-05-22 14:35:43 +02:00
parent 4c3c65dded
commit e8baa21d42
3 changed files with 14 additions and 5 deletions

View File

@@ -583,6 +583,7 @@ namespace mpvnet
break;
case mpv_event_id.MPV_EVENT_START_FILE:
InvokeEvent(StartFile, StartFileAsync);
App.RunTask(() => LoadFolder());
break;
case mpv_event_id.MPV_EVENT_AUDIO_RECONFIG:
InvokeEvent(AudioReconfig, AudioReconfigAsync);
@@ -1225,7 +1226,10 @@ namespace mpvnet
string dir = Environment.CurrentDirectory;
if (path.Contains(Path.DirectorySeparatorChar))
if (path.Contains(":/") && !path.Contains("://"))
path = path.Replace("/", "\\");
if (path.Contains("\\"))
dir = Path.GetDirectoryName(path);
List<string> files = Directory.GetFiles(dir).ToList();