Skip to content

Commit

Permalink
handle screenshot_ format
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-Juhasz committed Jan 20, 2024
1 parent 9619858 commit f18e4b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/PhotoArchiver/Archiver.Upload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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] == '_')
{
Expand Down

0 comments on commit f18e4b6

Please sign in to comment.