diff --git a/Changelog.md b/Changelog.md index 4d547bc..5a37848 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,11 @@ ### - fix: window restore was broken +- fix: it's possible to multi select files in File Explorer and press + enter to open the files, this did however only work when the + auto load folder feature was disabled or the shift key was + pressed (blocks auto load folder). Now it should also work + without shift key and with auto load folder being enabled. ### 5.4.2.1 Beta diff --git a/Clean.ps1 b/Clean.ps1 deleted file mode 100644 index f6dfcc0..0000000 --- a/Clean.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -function Remove($path) { - if (Test-Path $path) { - Remove-Item $path -Recurse -Force - } else { - Write-Host "Path don't exist: $path" - } -} - -Remove("obj") -Remove(".vs") -Remove("*.csproj.user") \ No newline at end of file diff --git a/mpv.net/mpv/mp.cs b/mpv.net/mpv/mp.cs index bc60a35..138956e 100644 --- a/mpv.net/mpv/mp.cs +++ b/mpv.net/mpv/mp.cs @@ -695,7 +695,7 @@ namespace mpvnet HideLogo(); - if ((DateTime.Now - LastLoad).TotalMilliseconds < 500) + if ((DateTime.Now - LastLoad).TotalMilliseconds < 1000) append = true; LastLoad = DateTime.Now; @@ -713,27 +713,34 @@ namespace mpvnet set_property_int("playlist-pos", 0); if (loadFolder && !append) - Task.Run(() => LoadFolder()); // user reported race condition + Task.Run(() => LoadFolder()); } public static void LoadFolder() { if (!App.AutoLoadFolder || Control.ModifierKeys.HasFlag(Keys.Shift)) return; - Thread.Sleep(200); // user reported race condition + + Thread.Sleep(1000); string path = get_property_string("path"); + if (!File.Exists(path) || get_property_int("playlist-count") != 1) return; + List files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList(); + files = files.Where(file => App.VideoTypes.Contains(file.ShortExt()) || App.AudioTypes.Contains(file.ShortExt()) || App.ImageTypes.Contains(file.ShortExt())).ToList(); + files.Sort(new StringLogicalComparer()); int index = files.IndexOf(path); files.Remove(path); + foreach (string i in files) commandv("loadfile", i, "append"); + if (index > 0) commandv("playlist-move", "0", (index + 1).ToString()); }