From 1fe12be0b57218adcca744fa327f2b78459095ae Mon Sep 17 00:00:00 2001 From: Hennadiy Brych Date: Wed, 28 Aug 2019 03:02:13 -0400 Subject: [PATCH] PSX date fixes (#157) * Sony PlayStation date extraction fixed, 3 separate issues: 1. 190x year instead of 200x 2. Failure to get date for some titles where SYSTEM.CNF BOOT record doesn't have backslash after "cdrom:" 3. Date shift by one day due to Utc offset applied Relaxed directory path requirements to allow dot and ampersand. DiscImageCreator had to be changed in order to support this, will be submitted separately. * Reverted extra path characters modification. * Reverted to UTC time --- DICUI.Library/Utilities/DumpEnvironment.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DICUI.Library/Utilities/DumpEnvironment.cs b/DICUI.Library/Utilities/DumpEnvironment.cs index 765ffa1b..d3ad73ed 100644 --- a/DICUI.Library/Utilities/DumpEnvironment.cs +++ b/DICUI.Library/Utilities/DumpEnvironment.cs @@ -1683,7 +1683,7 @@ namespace DICUI.Utilities line = sr.ReadLine(); // Once it finds the "BOOT" line, extract the name - exeName = Regex.Match(line, @"BOOT.*?=\s*cdrom.?:\\(.*?);.*").Groups[1].Value; + exeName = Regex.Match(line, @"BOOT.*?=\s*cdrom.?:\\?(.*?);.*").Groups[1].Value; } } catch @@ -1698,7 +1698,11 @@ namespace DICUI.Utilities return null; FileInfo fi = new FileInfo(exePath); - return fi.LastWriteTimeUtc.ToString("yyyy-MM-dd"); + + // fix year 200x reported as 190x, not elegant but this is Windows ISO9660 issue so this is the best we can do unless we parse output data track manually + DateTime dt = new DateTime(fi.LastWriteTimeUtc.Year >= 1900 && fi.LastWriteTimeUtc.Year < 1920 ? 2000 + fi.LastWriteTimeUtc.Year % 100 : fi.LastWriteTimeUtc.Year, + fi.LastWriteTimeUtc.Month, fi.LastWriteTimeUtc.Day); + return dt.ToString("yyyy-MM-dd"); } ///