diff --git a/README.md b/README.md index b0c9cbf..b2de39a 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,10 @@ mpv.net bugs and requests: ### 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 diff --git a/mpv.net/MainForm.cs b/mpv.net/MainForm.cs index 8ad39c2..fa76867 100644 --- a/mpv.net/MainForm.cs +++ b/mpv.net/MainForm.cs @@ -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); diff --git a/mpv.net/mp.cs b/mpv.net/mp.cs index bb8f21e..2223dd2 100644 --- a/mpv.net/mp.cs +++ b/mpv.net/mp.cs @@ -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 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()); }