multi select files in File Explorer fix

This commit is contained in:
Frank Skare
2019-10-30 17:31:19 +01:00
parent 05027cd458
commit b9b604bfe3
3 changed files with 15 additions and 14 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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<string> 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());
}