From 94de4aca61a37f2a93354fd126712ad8bc8cd210 Mon Sep 17 00:00:00 2001 From: ac79b0c6 <105047743+ac79b0c6@users.noreply.github.com> Date: Sun, 26 Jun 2022 17:29:31 +0800 Subject: update mkvtool-gui:fix bug --- mkvtool-gui/MainWindow.axaml.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'mkvtool-gui/MainWindow.axaml.cs') diff --git a/mkvtool-gui/MainWindow.axaml.cs b/mkvtool-gui/MainWindow.axaml.cs index 40b340f..4512bab 100644 --- a/mkvtool-gui/MainWindow.axaml.cs +++ b/mkvtool-gui/MainWindow.axaml.cs @@ -69,7 +69,7 @@ namespace mkvtool }).Start(); } } - + void lcb(mkvlib.LogLevel l, string str) { lcb(str); @@ -629,8 +629,14 @@ namespace mkvtool string cache = Path.Join(Environment.GetEnvironmentVariable(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "USERPROFILE" : "HOME"), ".mkvtool", "caches"); void Cache() { - string[] ccs = Directory.GetFiles(cache, "*.cache"); - mkvlib.Cache(ccs); + try + { + if (!Directory.Exists(cache)) + Directory.CreateDirectory(cache); + string[] ccs = Directory.GetFiles(cache, "*.cache"); + mkvlib.Cache(ccs); + } + catch { } } void SaveSettings() -- cgit v1.2.1