From 91fa89b0589a31ca15684cf8b5e27eb7930a1066 Mon Sep 17 00:00:00 2001 From: stax76 Date: Thu, 10 Mar 2022 18:27:33 +0100 Subject: [PATCH] Fix showing incorrect timestamps in About dialog of Store version --- docs/Changelog.md | 2 ++ src/Misc/App.cs | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 377f03b..8c9bbb6 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,4 +1,6 @@ +- Fix showing incorrect timestamps in About dialog of Store version. + 5.7.0.0 Stable (2022-03-09) - Improved title and chapter menu for Blu-Rays. diff --git a/src/Misc/App.cs b/src/Misc/App.cs index 7f28e65..24fc65c 100644 --- a/src/Misc/App.cs +++ b/src/Misc/App.cs @@ -130,8 +130,21 @@ namespace mpvnet } public static string Version => "Copyright (C) 2000-2022 mpv.net/mpv/mplayer\n" + - $"mpv.net {Application.ProductVersion} ({File.GetLastWriteTime(Application.ExecutablePath).ToShortDateString()})\n" + - $"{Core.GetPropertyString("mpv-version")} ({File.GetLastWriteTime(Folder.Startup + "mpv-2.dll").ToShortDateString()})\nffmpeg {Core.GetPropertyString("ffmpeg-version")}\nMediaInfo {FileVersionInfo.GetVersionInfo(Path.Combine(Application.StartupPath, "MediaInfo.dll")).FileVersion} ({File.GetLastWriteTime(Path.Combine(Application.StartupPath , "MediaInfo.dll")).ToShortDateString()})\nGPL v2 License"; + $"mpv.net {Application.ProductVersion}" + GetLastWriteTime(Application.ExecutablePath) + "\n" + + $"{Core.GetPropertyString("mpv-version")}" + GetLastWriteTime(Folder.Startup + "mpv-2.dll") + "\n" + + $"ffmpeg {Core.GetPropertyString("ffmpeg-version")}\n" + + $"MediaInfo {FileVersionInfo.GetVersionInfo(Path.Combine(Application.StartupPath, "MediaInfo.dll")).FileVersion}" + + GetLastWriteTime(Path.Combine(Application.StartupPath , "MediaInfo.dll")) + "\nGPL v2 License"; + + static string GetLastWriteTime(string path) + { + if (IsStoreVrsion) + return ""; + + return $" ({File.GetLastWriteTime(path).ToShortDateString()})"; + } + + static bool IsStoreVrsion => Application.StartupPath.Contains("FrankSkare.mpv.net"); public static void ShowException(object obj) {