This commit is contained in:
Frank Skare
2019-05-11 00:49:38 +02:00
parent be3b31f7e6
commit a9474b1c22
3 changed files with 11 additions and 4 deletions

View File

@@ -190,6 +190,10 @@ mpv.net bugs and requests: <https://github.com/stax76/mpv.net/issues>
### Changelog
### 3.6 (2019-??-??)
- playing files from rar archives caused an exception
### 3.5 (2019-05-09)
- when the main windows gets activated and the clipboard content starts with http

View File

@@ -341,7 +341,12 @@ namespace mpvnet
private void Mp_FileLoaded()
{
string path = mp.get_property_string("path");
BeginInvoke(new Action(() => { Text = Path.GetFileName(path) + " - mpv.net " + Application.ProductVersion; }));
BeginInvoke(new Action(() => {
if (File.Exists(path) || path.StartsWith("http"))
Text = Path.GetFileName(path) + " - mpv.net " + Application.ProductVersion;
else
Text = "mpv.net " + Application.ProductVersion;
}));
if (RecentFiles.Contains(path)) RecentFiles.Remove(path);
RecentFiles.Insert(0, path);
if (RecentFiles.Count > 15) RecentFiles.RemoveAt(15);

View File

@@ -565,17 +565,15 @@ namespace mpvnet
if (get_property_int("playlist-count") == 1)
{
string path = get_property_string("path");
if (!Directory.Exists(Path.GetDirectoryName(path))) return;
if (!File.Exists(path)) return;
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
files = files.Where((file) => App.VideoTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower()) ||
App.AudioTypes.Contains(Path.GetExtension(file).TrimStart('.').ToLower())).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());
}