From f18e4b6998dbebbe2531204540f7fef866a58c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Juh=C3=A1sz?= Date: Sat, 20 Jan 2024 18:01:00 +0100 Subject: [PATCH] handle screenshot_ format --- src/PhotoArchiver/Archiver.Upload.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PhotoArchiver/Archiver.Upload.cs b/src/PhotoArchiver/Archiver.Upload.cs index f0f57dc..87354b3 100644 --- a/src/PhotoArchiver/Archiver.Upload.cs +++ b/src/PhotoArchiver/Archiver.Upload.cs @@ -559,6 +559,13 @@ internal static bool TryParseDate(string fileName, out DateTime result) return true; } + // Screenshot_20190525_120904 + if (fileName.Length >= "Screenshot_20190525_120904".Length + 4 && fileName.StartsWith("Screenshot_2") && fileName["Screenshot".Length] == '_' && fileName["Screenshot_20190525".Length] == '_') + { + result = new DateTime(Int32.Parse(fileName.Substring("Screenshot_".Length, 4)), Int32.Parse(fileName.Substring("Screenshot_2019".Length, 2)), Int32.Parse(fileName.Substring("Screenshot_201905".Length, 2))); + return true; + } + // WP_20140711_15_25_11_0_Pro if (fileName.Length >= 11 + 4 && fileName.StartsWith("WP_") && fileName[11] == '_') {