LookForAbandoned,
DateTimeOriginalThenMinimumDateTime and IsNotUniqueAndNeedsReview
This commit is contained in:
@ -154,13 +154,14 @@ public class DateGroup
|
||||
string? check;
|
||||
string fileName;
|
||||
string? pathRoot;
|
||||
DateTime dateTime;
|
||||
string seasonName;
|
||||
string weekOfYear;
|
||||
bool? isWrongYear;
|
||||
string seasonValue;
|
||||
string directoryName;
|
||||
string topDirectoryName;
|
||||
DateTime minimumDateTime;
|
||||
List<DateTime> dateTimes;
|
||||
string[]? matches = null;
|
||||
string[] directorySegments;
|
||||
List<string> destinationCollection;
|
||||
@ -204,12 +205,22 @@ public class DateGroup
|
||||
directoryNames.Clear();
|
||||
destinationCollection = new();
|
||||
_ = destinationDirectoryName.Clear();
|
||||
if (item.ImageFileHolder.LastWriteTime is not null && item.Property is null)
|
||||
minimumDateTime = item.ImageFileHolder.LastWriteTime.Value;
|
||||
if (item.Property is not null)
|
||||
dateTimes = item.Property.GetDateTimes();
|
||||
else
|
||||
minimumDateTime = Shared.Models.Stateless.Methods.IProperty.GetMinimumDateTime(item.Property);
|
||||
day = minimumDateTime.ToString("MM-dd");
|
||||
month = minimumDateTime.ToString("MMMM");
|
||||
{
|
||||
if (item.ImageFileHolder.LastWriteTime is null)
|
||||
throw new Exception();
|
||||
dateTimes = new() { item.ImageFileHolder.LastWriteTime.Value };
|
||||
}
|
||||
if (item.ImageFileHolder.LastWriteTime is not null && item.Property is null)
|
||||
dateTime = item.ImageFileHolder.LastWriteTime.Value;
|
||||
else if (item.Property is not null && item.Property.DateTimeOriginal is not null)
|
||||
dateTime = item.Property.DateTimeOriginal.Value;
|
||||
else
|
||||
dateTime = Shared.Models.Stateless.Methods.IProperty.GetMinimumDateTime(item.Property);
|
||||
day = dateTime.ToString("MM-dd");
|
||||
month = dateTime.ToString("MMMM");
|
||||
if (item.Property?.Id is null)
|
||||
{
|
||||
flag = '#';
|
||||
@ -217,26 +228,26 @@ public class DateGroup
|
||||
}
|
||||
else
|
||||
{
|
||||
(isWrongYear, _) = item.Property.IsWrongYear(item.ImageFileHolder, minimumDateTime);
|
||||
(isWrongYear, _) = Shared.Models.Stateless.Methods.IProperty.IsWrongYear(item.ImageFileHolder, item.Property.DateTimeOriginal, dateTimes);
|
||||
if (isWrongYear is null)
|
||||
flag = '#';
|
||||
else if (isWrongYear.Value)
|
||||
flag = '~';
|
||||
else
|
||||
{
|
||||
if (item.Property.DateTimeOriginal.HasValue && minimumDateTime.DayOfYear != item.Property.DateTimeOriginal.Value.DayOfYear && Math.Abs(new TimeSpan(minimumDateTime.Ticks - item.Property.DateTimeOriginal.Value.Ticks).TotalHours) > 8)
|
||||
if (item.Property.DateTimeOriginal is not null && dateTime.DayOfYear != item.Property.DateTimeOriginal.Value.DayOfYear && Math.Abs(new TimeSpan(dateTime.Ticks - item.Property.DateTimeOriginal.Value.Ticks).TotalHours) > 8)
|
||||
flag = '^';
|
||||
else
|
||||
flag = '=';
|
||||
}
|
||||
}
|
||||
(season, seasonName) = Shared.Models.Stateless.Methods.IProperty.GetSeason(minimumDateTime.DayOfYear);
|
||||
(season, seasonName) = Shared.Models.Stateless.Methods.IProperty.GetSeason(dateTime.DayOfYear);
|
||||
if ((from l in topDirectorySegments where l == "Christmas" select true).Any())
|
||||
seasonValue = string.Empty;
|
||||
else
|
||||
seasonValue = $".{season}";
|
||||
if (isWrongYear is null || !isWrongYear.Value)
|
||||
year = $"{flag}{minimumDateTime:yyyy}{seasonValue}";
|
||||
year = $"{flag}{dateTime:yyyy}{seasonValue}";
|
||||
else if (matches is null || matches.Length < 3)
|
||||
year = "----";
|
||||
else
|
||||
@ -247,7 +258,7 @@ public class DateGroup
|
||||
year = $"{flag}{matches[0][1..].Split('.')[0]}{seasonValue}";
|
||||
}
|
||||
topDirectoryName = Path.GetFileName(topDirectory);
|
||||
weekOfYear = calendar.GetWeekOfYear(minimumDateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
weekOfYear = calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||
if (_Configuration.ByHash)
|
||||
directoryNames.Add($"{year} {seasonName}");
|
||||
else if (_Configuration.BySeason && topDirectoryName.Length == 1 && topDirectoryName[0] == '_')
|
||||
@ -296,9 +307,9 @@ public class DateGroup
|
||||
if (item.ImageFileHolder.LastWriteTime is null)
|
||||
continue;
|
||||
if (item.Property is not null)
|
||||
results.Add(new(item, item.Property.LastWriteTime.Ticks, minimumDateTime.Ticks, destinationCollection.ToArray()));
|
||||
results.Add(new(item, item.Property.LastWriteTime.Ticks, dateTime.Ticks, destinationCollection.ToArray()));
|
||||
else
|
||||
results.Add(new(item, item.ImageFileHolder.LastWriteTime.Value.Ticks, minimumDateTime.Ticks, destinationCollection.ToArray()));
|
||||
results.Add(new(item, item.ImageFileHolder.LastWriteTime.Value.Ticks, dateTime.Ticks, destinationCollection.ToArray()));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
@ -470,11 +481,11 @@ public class DateGroup
|
||||
string path;
|
||||
string fileName;
|
||||
string directory;
|
||||
DateTime dateTime;
|
||||
int selectedTotal;
|
||||
const int minimum = 3;
|
||||
List<DateTime> dateTimes;
|
||||
List<Item> selectedItems;
|
||||
DateTime? minimumDateTime;
|
||||
const int maximumHours = 24;
|
||||
string? relativePathDirectory;
|
||||
WindowsShortcut windowsShortcut;
|
||||
@ -499,9 +510,12 @@ public class DateGroup
|
||||
relativePathDirectory = Path.GetDirectoryName(item.RelativePath);
|
||||
if (string.IsNullOrEmpty(relativePathDirectory))
|
||||
continue;
|
||||
minimumDateTime = Shared.Models.Stateless.Methods.IProperty.GetMinimumDateTime(item.Property);
|
||||
if (minimumDateTime is null)
|
||||
continue;
|
||||
if (item.ImageFileHolder.LastWriteTime is not null && item.Property is null)
|
||||
dateTime = item.ImageFileHolder.LastWriteTime.Value;
|
||||
else if (item.Property is not null && item.Property.DateTimeOriginal is not null)
|
||||
dateTime = item.Property.DateTimeOriginal.Value;
|
||||
else
|
||||
dateTime = Shared.Models.Stateless.Methods.IProperty.GetMinimumDateTime(item.Property);
|
||||
path = Path.GetFullPath($"{configuration.RootDirectory}{item.RelativePath[..^5]}");
|
||||
directory = Path.Combine($"{aPropertyContentDirectory}{relativePathDirectory}", $"{dateTimes.Min():yyyy-MM-dd_HH-mm-ss}---{dateTimes.Max():yyyy-MM-dd_HH-mm-ss}");
|
||||
if (!Directory.Exists(directory))
|
||||
@ -514,7 +528,7 @@ public class DateGroup
|
||||
windowsShortcut.Dispose();
|
||||
if (!File.Exists(fileName))
|
||||
continue;
|
||||
File.SetLastWriteTime(fileName, minimumDateTime.Value);
|
||||
File.SetLastWriteTime(fileName, dateTime);
|
||||
}
|
||||
}
|
||||
if (selectedTotal < container.Items.Count && selectedTotal < (from l in container.Items where l.Property is not null select true).Count())
|
||||
|
@ -1,353 +1,25 @@
|
||||
{
|
||||
"Company": "Mike Phares",
|
||||
"Linux": {},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Log4netProvider": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
"Log4netProvider": "Debug"
|
||||
}
|
||||
},
|
||||
"MaxDegreeOfParallelism": 6,
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": "Debug",
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Debug",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "%workingDirectory% - Log/log-.txt",
|
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enrich": [
|
||||
"FromLogContext",
|
||||
"WithMachineName",
|
||||
"WithThreadId"
|
||||
],
|
||||
"Properties": {
|
||||
"Application": "Sample"
|
||||
}
|
||||
"MinimumLevel": "Debug"
|
||||
},
|
||||
"WorkingDirectoryName": "PharesApps",
|
||||
"Windows": {
|
||||
"Configuration": {
|
||||
"ByCreateDateShortcut": false,
|
||||
"ByDay": false,
|
||||
"ByHash": false,
|
||||
"BySeason": true,
|
||||
"ByWeek": false,
|
||||
"DateGroup": "1e85c0ba",
|
||||
"FileNameDirectorySeparator": ".Z.",
|
||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
||||
"KeepFullPath": false,
|
||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||
"PopulatePropertyId": false,
|
||||
"PropertiesChangedForProperty": false,
|
||||
"ResultAllInOne": "_ _ _",
|
||||
"ResultCollection": "[]",
|
||||
"ResultContent": "()",
|
||||
"ResultSingleton": "{}",
|
||||
"xByHash": false,
|
||||
"ByHash": true,
|
||||
"xPopulatePropertyId": false,
|
||||
"PopulatePropertyId": true,
|
||||
"xRootDirectory": "C:/Tmp/phares/Pictures",
|
||||
"xxRootDirectory": "C:/Tmp/Phares/Compare/Images-1e85c0ba",
|
||||
"xxxRootDirectory": "F:/Tmp/Phares/Compare/Not-Copy-Copy-1e85c0ba",
|
||||
"xxxxRootDirectory": "C:/Tmp/Phares/Compare/Not-Copy-Copy-1e85c0ba",
|
||||
"xxxxxRootDirectory": "F:/Tmp/Phares/2022-11-03-DCIM/DCIM/100D3400 2022",
|
||||
"xxxxxxRootDirectory": "E:/- - - Videos/-",
|
||||
"RootDirectory": "D:/2) Images B/Not-Copy-Copy/New folder/-",
|
||||
"WriteBitmapDataBytes": false,
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
".GIF",
|
||||
".pdf",
|
||||
".PDF"
|
||||
],
|
||||
"PropertyContentCollectionFiles": [],
|
||||
"ValidImageFormatExtensions": [
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"ValidMetadataExtensions": [
|
||||
".3gp",
|
||||
".3GP",
|
||||
".avi",
|
||||
".AVI",
|
||||
".bmp",
|
||||
".BMP",
|
||||
".gif",
|
||||
".GIF",
|
||||
".ico",
|
||||
".ICO",
|
||||
".jpeg",
|
||||
".JPEG",
|
||||
".jpg",
|
||||
".JPG",
|
||||
".m4v",
|
||||
".M4V",
|
||||
".mov",
|
||||
".MOV",
|
||||
".mp4",
|
||||
".MP4",
|
||||
".mta",
|
||||
".MTA",
|
||||
".png",
|
||||
".PNG",
|
||||
".tiff",
|
||||
".TIFF"
|
||||
],
|
||||
"VerifyToSeason": [
|
||||
". 2000",
|
||||
". 2001",
|
||||
". 2002",
|
||||
". 2003",
|
||||
". 2004",
|
||||
". 2005",
|
||||
". 2006",
|
||||
". 2007",
|
||||
". 2008",
|
||||
". 2009",
|
||||
". 2010",
|
||||
". 2011",
|
||||
". 2012",
|
||||
". 2013",
|
||||
". 2014",
|
||||
". 2015",
|
||||
". 2016",
|
||||
". 2017",
|
||||
". 2018",
|
||||
". 2019",
|
||||
". 2020",
|
||||
". 2021",
|
||||
". 2022",
|
||||
". 2023",
|
||||
". 2024",
|
||||
". 2025",
|
||||
". 2026",
|
||||
". 2027",
|
||||
". 2028",
|
||||
". 2029",
|
||||
"2000.0 Winter",
|
||||
"2002.1 Spring",
|
||||
"2002.4 Winter",
|
||||
"2003.0 Winter",
|
||||
"2003.1 Spring",
|
||||
"2003.3 Fall",
|
||||
"2003.4 Winter",
|
||||
"2004.0 Winter",
|
||||
"2005.1 Spring",
|
||||
"2005.2 Summer",
|
||||
"2005.3 Fall",
|
||||
"2005.4 Winter",
|
||||
"2006.0 Winter",
|
||||
"2006.1 Spring",
|
||||
"2006.3 Fall",
|
||||
"2007.0 Winter",
|
||||
"2007.2 Summer Logan Michael",
|
||||
"2007.2 Summer",
|
||||
"2007.3 Fall Logan Michael",
|
||||
"2007.4 Winter Logan Michael",
|
||||
"2008.0 Winter Logan Michael",
|
||||
"2008.1 Spring Logan Michael",
|
||||
"2008.2 Summer Logan Michael",
|
||||
"2008.2 Summer",
|
||||
"2008.3 Fall Logan Michael",
|
||||
"2009.0 Winter Logan Michael",
|
||||
"2009.0 Winter",
|
||||
"2009.1 Spring Logan Michael",
|
||||
"2009.1 Spring",
|
||||
"2009.2 Summer Logan Michael",
|
||||
"2009.2 Summer",
|
||||
"2009.3 Fall Logan Michael",
|
||||
"2009.3 Fall",
|
||||
"2009.4 Winter Logan Michael",
|
||||
"2009.4 Winter",
|
||||
"2010.0 Winter Logan Michael",
|
||||
"2010.0 Winter",
|
||||
"2010.1 Spring Logan Michael",
|
||||
"2010.1 Spring",
|
||||
"2010.2 Summer",
|
||||
"2010.3 Fall Logan Michael",
|
||||
"2010.3 Fall",
|
||||
"2010.4 Winter",
|
||||
"2011.0 Winter",
|
||||
"2011.1 Spring",
|
||||
"2011.2 Summer",
|
||||
"2011.3 Fall",
|
||||
"2011.4 Winter",
|
||||
"2012.0 Winter Chelsea 2012",
|
||||
"2012.0 Winter Chelsea",
|
||||
"2012.0 Winter",
|
||||
"2012.1 Spring Chelsea",
|
||||
"2012.1 Spring",
|
||||
"2012.2 Summer Chelsea",
|
||||
"2012.2 Summer",
|
||||
"2012.3 Fall Chelsea",
|
||||
"2012.3 Fall",
|
||||
"2012.4 Winter Chelsea",
|
||||
"2012.4 Winter",
|
||||
"2013.0 Winter Chelsea 2013",
|
||||
"2013.0 Winter Chelsea",
|
||||
"2013.0 Winter",
|
||||
"2013.1 Spring",
|
||||
"2013.2 Summer Chelsea",
|
||||
"2013.2 Summer",
|
||||
"2013.3 Fall Chelsea",
|
||||
"2013.3 Fall",
|
||||
"2013.4 Winter",
|
||||
"2014.0 Winter",
|
||||
"2014.1 Spring",
|
||||
"2014.2 Summer",
|
||||
"2014.3 Fall",
|
||||
"2014.4 Winter",
|
||||
"2015.0 Winter",
|
||||
"2015.1 Spring",
|
||||
"2015.2 Summer",
|
||||
"2015.3 Fall",
|
||||
"2015.4 Winter",
|
||||
"2016.0 Winter",
|
||||
"2016.1 Spring",
|
||||
"2016.2 Summer",
|
||||
"2016.3 Fall",
|
||||
"2016.4 Winter",
|
||||
"2017.1 Spring",
|
||||
"2017.2 Summer",
|
||||
"2017.3 Fall",
|
||||
"2017.4 Winter",
|
||||
"2018.0 Winter",
|
||||
"2018.1 Spring",
|
||||
"2018.3 Fall",
|
||||
"2018.4 Winter",
|
||||
"2019.0 Winter",
|
||||
"2019.1 Spring",
|
||||
"2019.2 Summer",
|
||||
"2019.3 Fall",
|
||||
"2019.4 Winter",
|
||||
"2020.0 Winter",
|
||||
"2020.1 Spring",
|
||||
"2020.2 Summer",
|
||||
"2020.3 Fall",
|
||||
"2020.4 Winter",
|
||||
"2021.1 Spring",
|
||||
"2021.2 Summer",
|
||||
"2021.3 Fall",
|
||||
"2021.4 Winter",
|
||||
"2022.0 Winter",
|
||||
"2022.1 Spring",
|
||||
"Anthem 2015",
|
||||
"April 2010",
|
||||
"April 2013",
|
||||
"December 2006",
|
||||
"December 2010",
|
||||
"Fall 2005",
|
||||
"Fall 2015",
|
||||
"Fall 2016",
|
||||
"Fall 2017",
|
||||
"Fall 2018",
|
||||
"Fall 2019",
|
||||
"Fall 2020",
|
||||
"Fall 2021",
|
||||
"February 2010",
|
||||
"January 2015",
|
||||
"July 2010",
|
||||
"June 2010",
|
||||
"Kids 2005",
|
||||
"March 2013",
|
||||
"May 2010",
|
||||
"May 2011",
|
||||
"May 2013",
|
||||
"October 2005",
|
||||
"October 2014",
|
||||
"Spring 2013",
|
||||
"Spring 2014",
|
||||
"Spring 2016",
|
||||
"Spring 2018",
|
||||
"Spring 2019",
|
||||
"Spring 2020",
|
||||
"Summer 2011",
|
||||
"Summer 2012",
|
||||
"Summer 2013",
|
||||
"Summer 2014",
|
||||
"Summer 2015",
|
||||
"Summer 2016",
|
||||
"Summer 2017",
|
||||
"Summer 2018",
|
||||
"Summer 2020",
|
||||
"Summer 2021",
|
||||
"Winter 2015",
|
||||
"Winter 2016",
|
||||
"Winter 2017",
|
||||
"Winter 2018",
|
||||
"Winter 2019-2020",
|
||||
"Winter 2020",
|
||||
"zzz 2005.0 Winter Tracy Pictures",
|
||||
"zzz 2005.1 Spring Tracy Pictures",
|
||||
"zzz 2005.2 Summer Tracy Pictures",
|
||||
"zzz 2005.3 Fall Tracy Pictures",
|
||||
"zzz 2005.4 Winter Tracy Pictures",
|
||||
"zzz 2006.1 Spring Tracy Pictures",
|
||||
"zzz 2007.0 Winter Tracy Pictures",
|
||||
"zzz 2007.2 Summer Tracy Pictures",
|
||||
"zzz 2008.0 Winter Tracy Pictures",
|
||||
"zzz 2008.2 Summer Tracy Pictures",
|
||||
"zzz 2009.0 Winter Tracy Pictures",
|
||||
"zzz 2009.2 Summer Tracy Pictures",
|
||||
"zzz 2009.3 Fall Tracy Pictures",
|
||||
"zzz 2009.4 Winter Tracy Pictures",
|
||||
"zzz 2010.0 Winter Tracy Pictures",
|
||||
"zzz 2010.1 Spring Tracy Pictures",
|
||||
"zzz 2010.2 Summer Tracy Pictures",
|
||||
"zzz 2010.3 Fall Tracy Pictures",
|
||||
"zzz 2011.0 Winter Tracy Pictures",
|
||||
"zzz 2011.1 Spring Tracy Pictures",
|
||||
"zzz 2011.2 Summer Tracy Pictures",
|
||||
"zzz 2011.3 Fall Tracy Pictures",
|
||||
"zzz 2011.4 Winter Tracy Pictures",
|
||||
"zzz 2012.0 Winter Tracy Pictures",
|
||||
"zzz 2012.1 Spring Tracy Pictures",
|
||||
"zzz 2012.2 Summer Tracy Pictures",
|
||||
"zzz 2012.3 Fall Tracy Pictures",
|
||||
"zzz 2012.4 Winter Tracy Pictures",
|
||||
"zzz 2013.0 Winter Tracy Pictures",
|
||||
"zzz 2013.1 Spring Tracy Pictures",
|
||||
"zzz 2013.2 Summer Tracy Pictures",
|
||||
"zzz 2013.3 Fall Tracy Pictures",
|
||||
"zzz 2013.4 Winter Tracy Pictures",
|
||||
"zzz 2014.0 Winter Tracy Pictures",
|
||||
"zzz 2014.1 Spring Tracy Pictures",
|
||||
"zzz 2014.2 Summer Tracy Pictures",
|
||||
"zzz 2014.3 Fall Tracy Pictures",
|
||||
"zzz 2014.4 Winter Tracy Pictures",
|
||||
"zzz 2015.0 Winter Tracy Pictures"
|
||||
]
|
||||
"RootDirectory": "D:/1) Images A/Images-1e85c0ba/zzz Mackenzie Laptop !9/_"
|
||||
}
|
||||
}
|
||||
}
|
@ -67,10 +67,7 @@
|
||||
"ResultCollection": "[]",
|
||||
"ResultContent": "()",
|
||||
"ResultSingleton": "{}",
|
||||
"xRootDirectory": "C:/Tmp/phares/Pictures",
|
||||
"xxRootDirectory": "C:/Tmp/Phares/Compare/Images-1e85c0ba",
|
||||
"RootDirectory": "F:/Tmp/Phares/Compare/Not-Copy-Copy-1e85c0ba",
|
||||
"xxxxRootDirectory": "F:/Tmp/Phares/2022-11-03-DCIM/DCIM/100D3400 2022",
|
||||
"RootDirectory": "C:/Tmp/phares/Pictures",
|
||||
"WriteBitmapDataBytes": false,
|
||||
"IgnoreExtensions": [
|
||||
".gif",
|
||||
|
Reference in New Issue
Block a user