Rename
editorconfig
This commit is contained in:
@ -142,7 +142,7 @@ public class DuplicateSearch
|
||||
|
||||
private static Dictionary<int, List<MappingFromItem?>> GetIdToCollection(string argZero, Configuration configuration, bool argZeroIsConfigurationRootDirectory, Container[] containers, string destinationRoot, List<int> preloadIds)
|
||||
{
|
||||
Dictionary<int, List<MappingFromItem?>> results = new();
|
||||
Dictionary<int, List<MappingFromItem?>> results = [];
|
||||
string directory;
|
||||
const int zero = 0;
|
||||
Item[] filteredItems;
|
||||
@ -151,19 +151,19 @@ public class DuplicateSearch
|
||||
MappingFromItem? mappingFromItem;
|
||||
List<MappingFromItem?>? collection;
|
||||
const string duplicates = "-Duplicate(s)";
|
||||
if (containers.Any())
|
||||
if (containers.Length != 0)
|
||||
{
|
||||
foreach (int id in preloadIds)
|
||||
results.Add(id, new() { null });
|
||||
results.Add(id, [null]);
|
||||
}
|
||||
foreach (Container container in containers)
|
||||
{
|
||||
if (!container.Items.Any())
|
||||
if (container.Items.Count == 0)
|
||||
continue;
|
||||
if (!argZeroIsConfigurationRootDirectory && !container.SourceDirectory.StartsWith(argZero))
|
||||
continue;
|
||||
filteredItems = Shared.Models.Stateless.Methods.IContainer.GetFilterItems(configuration, container);
|
||||
if (!filteredItems.Any())
|
||||
if (filteredItems.Length == 0)
|
||||
continue;
|
||||
containerDateTimes = Shared.Models.Stateless.Methods.IContainer.GetContainerDateTimes(filteredItems);
|
||||
foreach (Item item in filteredItems)
|
||||
@ -175,7 +175,7 @@ public class DuplicateSearch
|
||||
continue;
|
||||
}
|
||||
if (!results.TryGetValue(item.Property.Id.Value, out collection))
|
||||
results.Add(item.Property.Id.Value, new());
|
||||
results.Add(item.Property.Id.Value, []);
|
||||
if (collection is null && !results.TryGetValue(item.Property.Id.Value, out collection))
|
||||
continue;
|
||||
if (collection.Count == 0)
|
||||
@ -188,7 +188,7 @@ public class DuplicateSearch
|
||||
if (mappingFromItem is not null)
|
||||
{
|
||||
resizedFileHolder = new(mappingFromItem.ResizedFileHolder.FullName.Replace($"0{duplicates}", $"1{duplicates}"));
|
||||
collection[0] = new(mappingFromItem.ContainerDateTimes, item.Property.DateTimeDigitized, item.Property.DateTimeOriginal, mappingFromItem.Id, mappingFromItem.ImageFileHolder, mappingFromItem.IsWrongYear, item.Property.Keywords ?? Array.Empty<string>(), mappingFromItem.MinimumDateTime, item.Property.Model, mappingFromItem.RelativePath, resizedFileHolder);
|
||||
collection[0] = new(mappingFromItem.ContainerDateTimes, item.Property.DateTimeDigitized, item.Property.DateTimeOriginal, mappingFromItem.Id, mappingFromItem.ImageFileHolder, mappingFromItem.IsWrongYear, item.Property.Keywords ?? [], mappingFromItem.MinimumDateTime, item.Property.Model, mappingFromItem.RelativePath, resizedFileHolder);
|
||||
}
|
||||
}
|
||||
resizedFileHolder = new(string.Concat(Path.Combine(destinationRoot, directory), item.RelativePath));
|
||||
@ -201,8 +201,8 @@ public class DuplicateSearch
|
||||
|
||||
private static List<(FileHolder ImageFileHolder, string Destination)> GetCollectionAndCreateDirectories(Dictionary<int, List<MappingFromItem?>> idToCollection)
|
||||
{
|
||||
List<(FileHolder ImageFileHolder, string Destination)> results = new();
|
||||
List<string> collection = new();
|
||||
List<(FileHolder ImageFileHolder, string Destination)> results = [];
|
||||
List<string> collection = [];
|
||||
foreach (KeyValuePair<int, List<MappingFromItem?>> keyValuePair in idToCollection)
|
||||
{
|
||||
foreach (MappingFromItem? mappingFromItem in keyValuePair.Value)
|
||||
@ -225,7 +225,7 @@ public class DuplicateSearch
|
||||
|
||||
private static List<int> GetPreloadIds(string destinationRoot)
|
||||
{
|
||||
List<int> results = new();
|
||||
List<int> results = [];
|
||||
string[] lines;
|
||||
string preloadDirectory = Path.Combine(destinationRoot, "Preload");
|
||||
if (!Directory.Exists(preloadDirectory))
|
||||
|
@ -60,7 +60,7 @@ public class Program
|
||||
if (args is not null)
|
||||
Secondary(logger, args.ToList());
|
||||
else
|
||||
Secondary(logger, new List<string>());
|
||||
Secondary(logger, []);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user