Compare commits

...

1 Commits
5.2 ... 5.2.1

Author SHA1 Message Date
Frank Skare
1447636eb7 fixed race condition causing various features to fail 2019-08-07 13:16:05 +02:00
5 changed files with 21 additions and 20 deletions

View File

@@ -1,3 +1,7 @@
### 5.2.1
- fixed race condition causing various features to fail
### 5.2 ### 5.2
- bug fix for single-instance not working with unicode filenames - bug fix for single-instance not working with unicode filenames

View File

@@ -15,7 +15,7 @@ namespace mpvnet
public static string[] UrlWhitelist { get; set; } = { "tube", "vimeo", "ard", "zdf" }; public static string[] UrlWhitelist { get; set; } = { "tube", "vimeo", "ard", "zdf" };
public static string RegPath { get; } = @"HKCU\Software\" + Application.ProductName; public static string RegPath { get; } = @"HKCU\Software\" + Application.ProductName;
public static string ConfPath { get; } = mp.ConfigFolder + "\\mpvnet.conf"; public static string ConfPath { get => mp.ConfigFolder + "mpvnet.conf"; }
public static string DarkMode { get; set; } = "always"; public static string DarkMode { get; set; } = "always";
public static string ProcessInstance { get; set; } = "single"; public static string ProcessInstance { get; set; } = "single";
public static string DarkColor { get; set; } public static string DarkColor { get; set; }
@@ -49,7 +49,7 @@ namespace mpvnet
{ {
try try
{ {
string filePath = mp.ConfigFolder + "\\mpvnet-debug.log"; string filePath = mp.ConfigFolder + "mpvnet-debug.log";
if (File.Exists(filePath)) File.Delete(filePath); if (File.Exists(filePath)) File.Delete(filePath);
Trace.Listeners.Add(new TextWriterTraceListener(filePath)); Trace.Listeners.Add(new TextWriterTraceListener(filePath));
Trace.AutoFlush = true; Trace.AutoFlush = true;

View File

@@ -34,7 +34,7 @@ namespace mpvnet
} }
} }
dir = mp.ConfigFolder + "Extensions"; dir = mp.ConfigFolder + "extensions";
if (Directory.Exists(dir)) if (Directory.Exists(dir))
foreach (string i in Directory.GetDirectories(dir)) foreach (string i in Directory.GetDirectories(dir))

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.2.0.0")] [assembly: AssemblyVersion("5.2.1.0")]
[assembly: AssemblyFileVersion("5.2.0.0")] [assembly: AssemblyFileVersion("5.2.1.0")]

View File

@@ -70,8 +70,8 @@ namespace mpvnet
public static AutoResetEvent ShutdownAutoResetEvent { get; set; } = new AutoResetEvent(false); public static AutoResetEvent ShutdownAutoResetEvent { get; set; } = new AutoResetEvent(false);
public static AutoResetEvent VideoSizeAutoResetEvent { get; set; } = new AutoResetEvent(false); public static AutoResetEvent VideoSizeAutoResetEvent { get; set; } = new AutoResetEvent(false);
public static string InputConfPath { get; } = ConfigFolder + "\\input.conf"; public static string InputConfPath { get => ConfigFolder + "input.conf"; }
public static string ConfPath { get; } = ConfigFolder + "\\mpv.conf"; public static string ConfPath { get => ConfigFolder + "mpv.conf"; }
public static string Sid { get; set; } = ""; public static string Sid { get; set; } = "";
public static string Aid { get; set; } = ""; public static string Aid { get; set; } = "";
public static string Vid { get; set; } = ""; public static string Vid { get; set; } = "";
@@ -201,14 +201,14 @@ namespace mpvnet
if (!_ConfigFolder.Contains("portable_config")) if (!_ConfigFolder.Contains("portable_config"))
RegHelp.SetObject(App.RegPath, "ConfigFolder", _ConfigFolder); RegHelp.SetObject(App.RegPath, "ConfigFolder", _ConfigFolder);
if (!File.Exists(_ConfigFolder + "\\input.conf")) if (!File.Exists(_ConfigFolder + "input.conf"))
File.WriteAllText(_ConfigFolder + "\\input.conf", Properties.Resources.inputConf); File.WriteAllText(_ConfigFolder + "input.conf", Properties.Resources.inputConf);
if (!File.Exists(_ConfigFolder + "\\mpv.conf")) if (!File.Exists(_ConfigFolder + "mpv.conf"))
File.WriteAllText(_ConfigFolder + "\\mpv.conf", Properties.Resources.mpvConf); File.WriteAllText(_ConfigFolder + "mpv.conf", Properties.Resources.mpvConf);
if (!File.Exists(_ConfigFolder + "\\mpvnet.conf")) if (!File.Exists(_ConfigFolder + "mpvnet.conf"))
File.WriteAllText(_ConfigFolder + "\\mpvnet.conf", Properties.Resources.mpvNetConf); File.WriteAllText(_ConfigFolder + "mpvnet.conf", Properties.Resources.mpvNetConf);
} }
return _ConfigFolder; return _ConfigFolder;
} }
@@ -266,8 +266,8 @@ namespace mpvnet
} }
} }
if (Directory.Exists(ConfigFolder + "Scripts")) if (Directory.Exists(ConfigFolder + "scripts"))
foreach (string scriptPath in Directory.GetFiles(ConfigFolder + "Scripts")) foreach (string scriptPath in Directory.GetFiles(ConfigFolder + "scripts"))
if (scriptPath.EndsWith(".py")) if (scriptPath.EndsWith(".py"))
PythonScripts.Add(new PythonScript(File.ReadAllText(scriptPath))); PythonScripts.Add(new PythonScript(File.ReadAllText(scriptPath)));
else if (scriptPath.EndsWith(".ps1")) else if (scriptPath.EndsWith(".ps1"))
@@ -734,11 +734,8 @@ namespace mpvnet
if (File.Exists(LastHistoryPath) && totalMinutes > 1) if (File.Exists(LastHistoryPath) && totalMinutes > 1)
{ {
string historyFilepath = ConfigFolder + "history.txt"; File.AppendAllText(ConfigFolder + "history.txt", DateTime.Now.ToString().Substring(0, 16) +
" " + totalMinutes.ToString().PadLeft(3) + " " + Path.GetFileNameWithoutExtension(LastHistoryPath) + "\r\n");
File.AppendAllText(historyFilepath, DateTime.Now.ToString().Substring(0, 16) +
" " + totalMinutes.ToString().PadLeft(3) + " " +
Path.GetFileNameWithoutExtension(LastHistoryPath) + "\r\n");
} }
LastHistoryPath = path; LastHistoryPath = path;