Added FileHolder

This commit is contained in:
2022-08-08 19:23:48 -07:00
parent daf5f428b9
commit 3aeab88384
15 changed files with 448 additions and 288 deletions

View File

@ -81,8 +81,8 @@ public class B_Metadata
public (int, List<KeyValuePair<string, string>>) GetMetadataCollection(List<Tuple<string, DateTime>> subFileTuples, List<string> parseExceptions, Property.Models.PropertyHolder propertyHolder)
{
List<KeyValuePair<string, string>> results = new();
if (propertyHolder.ImageFileInfo is null)
throw new Exception($"{propertyHolder.ImageFileInfo} is null!");
if (propertyHolder.ImageFileHolder is null)
throw new Exception($"{propertyHolder.ImageFileHolder} is null!");
Dictionary<string, List<KeyValuePair<string, string>>>? dictionary;
string json = string.Empty;
string[] changesFrom = Array.Empty<string>();
@ -135,7 +135,7 @@ public class B_Metadata
}
if (dictionary is null || !dictionary.Any())
{
dictionary = GetMetadataCollection(propertyHolder.ImageFileInfo.FullName);
dictionary = GetMetadataCollection(propertyHolder.ImageFileHolder.FullName);
json = JsonSerializer.Serialize(dictionary, _WriteIndentedJsonSerializerOptions);
bool updateDateWhenMatches = dateTimes.Any() && fileInfo.Exists && dateTimes.Max() > fileInfo.LastWriteTime;
DateTime? dateTime = !updateDateWhenMatches ? null : dateTimes.Max();