2023-03-18
This commit is contained in:
parent
d38c558128
commit
79bcbf3487
@ -35,8 +35,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
||||
|
@ -34,9 +34,9 @@
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.7.2" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
|
@ -35,8 +35,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
||||
|
@ -35,8 +35,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
||||
|
@ -35,8 +35,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
||||
|
@ -34,9 +34,9 @@
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.2" />
|
||||
|
@ -67,6 +67,7 @@ internal class F_Random
|
||||
List<string>? collection;
|
||||
string dateFormat = "MM-dd";
|
||||
List<string> relativePaths = new();
|
||||
List<int> distinctCollection = new();
|
||||
DateTime dateTime = new(2024, 1, 1); //Leap year
|
||||
Dictionary<string, List<string>> dayToRelativePaths = Get(personKeyToIds, mappingCollection, dateFormat);
|
||||
string fRandomCollectionDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(configuration, nameof(F_Random), "[]");
|
||||
@ -75,11 +76,14 @@ internal class F_Random
|
||||
File.Delete(file);
|
||||
foreach (Shared.Models.Mapping mapping in mappingCollection)
|
||||
{
|
||||
if (distinctCollection.Contains(mapping.MappingFromItem.Id))
|
||||
continue;
|
||||
if (mapping.MappingFromItem.ImageFileHolder.DirectoryName is null)
|
||||
continue;
|
||||
if (mapping.MappingFromFilter.IsIgnoreRelativePath is not null && mapping.MappingFromFilter.IsIgnoreRelativePath.Value)
|
||||
continue;
|
||||
relativePaths.Add(mapping.MappingFromItem.RelativePath);
|
||||
distinctCollection.Add(mapping.MappingFromItem.Id);
|
||||
}
|
||||
if (relativePaths.Any())
|
||||
{
|
||||
|
@ -974,16 +974,21 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
if (_Configuration is null)
|
||||
throw new NullReferenceException(nameof(_Configuration));
|
||||
(int, FileHolder, int, string, string, string, string)[] results;
|
||||
int count = 0;
|
||||
int group = 65;
|
||||
string checkFile;
|
||||
string directory;
|
||||
string? directoryName;
|
||||
string personDirectory;
|
||||
string personKeyFormatted;
|
||||
List<int> distinctCollection = new();
|
||||
bool usePersonKeyAndDeterministicHashCodeKey = false;
|
||||
List<string> personKeyFormattedCollection = GetPersonKeyFormattedCollection(jLinks, a2PeopleContentDirectory, personContainers, personKeyToIds);
|
||||
List<(int Id, FileHolder ImageFileHolder, int ApproximateYears, string PersonKeyFormatted, string CheckFile, string Directory, string PersonDirectory)> collection = new();
|
||||
foreach (Mapping mapping in mappingCollection)
|
||||
{
|
||||
if (distinctCollection.Contains(mapping.MappingFromItem.Id))
|
||||
continue;
|
||||
directoryName = Path.GetDirectoryName(mapping.MappingFromItem.RelativePath);
|
||||
if (directoryName is null)
|
||||
throw new NotSupportedException();
|
||||
@ -1002,7 +1007,12 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
continue;
|
||||
if (!usePersonKeyAndDeterministicHashCodeKey)
|
||||
{
|
||||
directory = Path.Combine(_EDistanceContentTicksDirectory, "Images");
|
||||
if (count > 499)
|
||||
{
|
||||
count = 0;
|
||||
group += 1;
|
||||
}
|
||||
directory = Path.Combine(_EDistanceContentTicksDirectory, ((char)group).ToString());
|
||||
personDirectory = Path.Combine(directory, mapping.MappingFromPerson.DisplayDirectoryName);
|
||||
checkFile = Path.Combine(directory, $"{mapping.MappingFromItem.Id}{mapping.MappingFromItem.ImageFileHolder.ExtensionLowered}");
|
||||
}
|
||||
@ -1013,6 +1023,8 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
checkFile = Path.Combine(directory, $"{mapping.MappingFromLocation.DeterministicHashCodeKey}{mapping.MappingFromItem.ImageFileHolder.ExtensionLowered}");
|
||||
}
|
||||
collection.Add(new(mapping.MappingFromItem.Id, mapping.MappingFromItem.ImageFileHolder, mapping.MappingFromPerson.ApproximateYears.Value, personKeyFormatted, directory, personDirectory, checkFile));
|
||||
distinctCollection.Add(mapping.MappingFromItem.Id);
|
||||
count += 1;
|
||||
}
|
||||
results = (from l in collection orderby l.ApproximateYears descending, l.PersonKeyFormatted descending select l).ToArray();
|
||||
return results;
|
||||
@ -1074,15 +1086,11 @@ public class MapLogic : Shared.Models.Methods.IMapLogic
|
||||
if (_Configuration is null)
|
||||
throw new NullReferenceException(nameof(_Configuration));
|
||||
SaveContainer? saveContainer;
|
||||
List<int> distinctCollection = new();
|
||||
List<SaveContainer> saveContainers = new();
|
||||
BeforeSaveFilteredOriginalImagesFromJLinks(jLinks, a2PeopleContentDirectory);
|
||||
(int, FileHolder, int, string, string, string, string)[] collection = GetCollectionForSaveFilteredOriginalImagesFromJLinks(jLinks, a2PeopleContentDirectory, personContainers, mappingCollection, personKeyToIds);
|
||||
foreach ((int id, FileHolder imageFileHolder, int approximateYears, string personKeyFormatted, string directory, string personDirectory, string checkFile) in collection)
|
||||
{
|
||||
if (distinctCollection.Contains(id))
|
||||
continue;
|
||||
distinctCollection.Add(id);
|
||||
saveContainer = new(personDirectory);
|
||||
saveContainers.Add(saveContainer);
|
||||
saveContainer = new(imageFileHolder, checkFile, directory);
|
||||
|
@ -43,8 +43,8 @@
|
||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.2" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.7.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user