From 62b532531f1b0ce4967dfbdcd158baaa41594155 Mon Sep 17 00:00:00 2001 From: Patrick Hogenboom Date: Tue, 7 Feb 2023 22:35:59 +0100 Subject: [PATCH] Get project last modified date from solution or folder date Folder date isn't modified on bitlocker volumes --- UnityLauncherPro/GetProjects.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UnityLauncherPro/GetProjects.cs b/UnityLauncherPro/GetProjects.cs index 836d509..5538748 100644 --- a/UnityLauncherPro/GetProjects.cs +++ b/UnityLauncherPro/GetProjects.cs @@ -146,8 +146,12 @@ static Project GetProjectInfo(string projectPath, bool getGitBranch = false, boo //Console.WriteLine("valueName="+ valueName+" , projectName =" + projectName); - // get last modified date from folder - DateTime? lastUpdated = folderExists ? Tools.GetLastModifiedTime(projectPath) : null; + // get last modified date from most recent date of solution or folder + string solutionPath = Path.Combine(projectPath, $"{projectName}.sln"); + bool solutionExists = File.Exists(solutionPath); + DateTime? solutionLastUpdated = solutionExists ? Tools.GetLastModifiedTime(solutionPath) : null; + DateTime? folderLastUpdated = folderExists ? Tools.GetLastModifiedTime(projectPath) : null; + DateTime? lastUpdated = solutionLastUpdated > folderLastUpdated ? solutionLastUpdated : folderLastUpdated; // get project version string projectVersion = folderExists ? Tools.GetProjectVersion(projectPath) : null;