Model changes for Unit Test Face
This commit is contained in:
@ -78,14 +78,16 @@ public class B_Metadata
|
||||
return results;
|
||||
}
|
||||
|
||||
public (int, List<KeyValuePair<string, string>>) GetMetadataCollection(List<Tuple<string, DateTime>> subFileTuples, List<string> parseExceptions, string subFile, string relativePath, string fileNameWithoutExtension)
|
||||
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!");
|
||||
Dictionary<string, List<KeyValuePair<string, string>>>? dictionary;
|
||||
string json = string.Empty;
|
||||
string[] changesFrom = Array.Empty<string>();
|
||||
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
||||
FileInfo fileInfo = new(Path.Combine(AngleBracketCollection[0].Replace("<>", "{}"), string.Concat(fileNameWithoutExtension, ".json")));
|
||||
FileInfo fileInfo = new(Path.Combine(AngleBracketCollection[0].Replace("<>", "{}"), string.Concat(propertyHolder.ImageFileNameWithoutExtension, ".json")));
|
||||
if (!fileInfo.Exists)
|
||||
{
|
||||
if (fileInfo.Directory?.Parent is null)
|
||||
@ -133,7 +135,7 @@ public class B_Metadata
|
||||
}
|
||||
if (dictionary is null || !dictionary.Any())
|
||||
{
|
||||
dictionary = GetMetadataCollection(subFile);
|
||||
dictionary = GetMetadataCollection(propertyHolder.ImageFileInfo.FullName);
|
||||
json = JsonSerializer.Serialize(dictionary, _WriteIndentedJsonSerializerOptions);
|
||||
if (Property.Models.Stateless.IPath.WriteAllText(fileInfo.FullName, json, compareBeforeWrite: true))
|
||||
{
|
||||
|
Reference in New Issue
Block a user