From 5b9e748ba4fef050ab134fd3afd65f399d368de5 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Sat, 13 Jul 2024 10:05:31 -0700 Subject: [PATCH] FileAttributes.Hidden Nuget Bump --- .../BlurHash.System.Drawing.Common.csproj | 2 +- BlurHash/BlurHash.csproj | 4 +- Compare/Compare.csproj | 12 ++--- Date-Group/Date-Group.csproj | 12 ++--- Delete-By-Distinct/Delete-By-Distinct.csproj | 12 ++--- Delete-By-Relative/Delete-By-Relative.csproj | 12 ++--- Distance/Distance.csproj | 2 +- Drag-Drop-Move/Drag-Drop-Move.csproj | 2 +- Duplicate-Search/Duplicate-Search.csproj | 12 ++--- Face/Face.csproj | 2 +- FaceParts/FaceParts.csproj | 2 +- Instance/DlibDotNet.cs | 6 ++- Instance/Instance.csproj | 12 ++--- Map/Map.csproj | 4 +- Map/Models/MapLogic.cs | 4 +- Metadata-Query/Metadata-Query.csproj | 2 +- Metadata/Metadata.csproj | 2 +- Mirror-Length/Mirror-Length.csproj | 2 +- .../Offset-Date-Time-Original.csproj | 2 +- PhotoPrism/PhotoPrism.csproj | 4 +- PrepareForOld/PrepareForOld.csproj | 10 ++-- Property-Compare/Property-Compare.csproj | 4 +- Property/Property.csproj | 4 +- Rename/Rename.csproj | 2 +- Resize/Resize.csproj | 4 +- Shared/Models/FileHolder.cs | 51 +++++++++---------- .../Models/Stateless/Methods/IFileHolder.cs | 5 ++ Shared/View-by-Distance.Shared.csproj | 4 +- Tests/Tests.csproj | 8 +-- .../TestsWithFaceRecognitionDotNet.csproj | 8 +-- ThumbHash/ThumbHash.csproj | 6 +-- 31 files changed, 112 insertions(+), 106 deletions(-) diff --git a/BlurHash.System.Drawing.Common/BlurHash.System.Drawing.Common.csproj b/BlurHash.System.Drawing.Common/BlurHash.System.Drawing.Common.csproj index c265079..abf94bb 100644 --- a/BlurHash.System.Drawing.Common/BlurHash.System.Drawing.Common.csproj +++ b/BlurHash.System.Drawing.Common/BlurHash.System.Drawing.Common.csproj @@ -24,6 +24,6 @@ - + \ No newline at end of file diff --git a/BlurHash/BlurHash.csproj b/BlurHash/BlurHash.csproj index 590a8bd..a525586 100644 --- a/BlurHash/BlurHash.csproj +++ b/BlurHash/BlurHash.csproj @@ -33,8 +33,8 @@ - - + + diff --git a/Compare/Compare.csproj b/Compare/Compare.csproj index ae09ace..f0c3cf1 100644 --- a/Compare/Compare.csproj +++ b/Compare/Compare.csproj @@ -34,13 +34,13 @@ - - - + + + - - - + + + diff --git a/Date-Group/Date-Group.csproj b/Date-Group/Date-Group.csproj index a4ffa46..df54865 100644 --- a/Date-Group/Date-Group.csproj +++ b/Date-Group/Date-Group.csproj @@ -34,15 +34,15 @@ - + - - + + - - - + + + diff --git a/Delete-By-Distinct/Delete-By-Distinct.csproj b/Delete-By-Distinct/Delete-By-Distinct.csproj index 0edd074..eabef86 100644 --- a/Delete-By-Distinct/Delete-By-Distinct.csproj +++ b/Delete-By-Distinct/Delete-By-Distinct.csproj @@ -35,13 +35,13 @@ - - - + + + - - - + + + diff --git a/Delete-By-Relative/Delete-By-Relative.csproj b/Delete-By-Relative/Delete-By-Relative.csproj index 9b019f3..285810e 100644 --- a/Delete-By-Relative/Delete-By-Relative.csproj +++ b/Delete-By-Relative/Delete-By-Relative.csproj @@ -35,13 +35,13 @@ - - - + + + - - - + + + diff --git a/Distance/Distance.csproj b/Distance/Distance.csproj index 75f1676..5240318 100644 --- a/Distance/Distance.csproj +++ b/Distance/Distance.csproj @@ -36,7 +36,7 @@ - + diff --git a/Drag-Drop-Move/Drag-Drop-Move.csproj b/Drag-Drop-Move/Drag-Drop-Move.csproj index e85ff96..b906859 100644 --- a/Drag-Drop-Move/Drag-Drop-Move.csproj +++ b/Drag-Drop-Move/Drag-Drop-Move.csproj @@ -29,7 +29,7 @@ - + diff --git a/Duplicate-Search/Duplicate-Search.csproj b/Duplicate-Search/Duplicate-Search.csproj index 3deaeec..349cfe0 100644 --- a/Duplicate-Search/Duplicate-Search.csproj +++ b/Duplicate-Search/Duplicate-Search.csproj @@ -34,13 +34,13 @@ - - - + + + - - - + + + diff --git a/Face/Face.csproj b/Face/Face.csproj index 37f262f..f421da7 100644 --- a/Face/Face.csproj +++ b/Face/Face.csproj @@ -33,7 +33,7 @@ - + diff --git a/FaceParts/FaceParts.csproj b/FaceParts/FaceParts.csproj index 7bd2ae2..a4994f8 100644 --- a/FaceParts/FaceParts.csproj +++ b/FaceParts/FaceParts.csproj @@ -33,7 +33,7 @@ - + diff --git a/Instance/DlibDotNet.cs b/Instance/DlibDotNet.cs index f27e7b8..ff33baa 100644 --- a/Instance/DlibDotNet.cs +++ b/Instance/DlibDotNet.cs @@ -255,6 +255,7 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable private ReadOnlyCollection GetNotNineCollection(ReadOnlyCollection filesCollection) { List results = []; + FileInfo fileInfo; FilePath filePath; FileHolder fileHolder; foreach (string[] files in filesCollection) @@ -263,7 +264,10 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable { if (!file.Contains(" !9")) continue; - fileHolder = Shared.Models.Stateless.Methods.IFileHolder.Get(file); + fileInfo = new(file); + fileHolder = Shared.Models.Stateless.Methods.IFileHolder.Get(fileInfo); + if (!fileInfo.Attributes.HasFlag(FileAttributes.Hidden)) + File.SetAttributes(fileHolder.FullName, FileAttributes.Hidden); filePath = FilePath.Get(_Configuration.PropertyConfiguration, fileHolder, index: null); if (filePath.Id is null) continue; diff --git a/Instance/Instance.csproj b/Instance/Instance.csproj index 9904295..a407e3f 100644 --- a/Instance/Instance.csproj +++ b/Instance/Instance.csproj @@ -34,15 +34,15 @@ - + - - - - + + + + - + diff --git a/Map/Map.csproj b/Map/Map.csproj index d56731b..143fae2 100644 --- a/Map/Map.csproj +++ b/Map/Map.csproj @@ -36,8 +36,8 @@ - - + + diff --git a/Map/Models/MapLogic.cs b/Map/Models/MapLogic.cs index 649d778..309d720 100644 --- a/Map/Models/MapLogic.cs +++ b/Map/Models/MapLogic.cs @@ -362,7 +362,6 @@ public partial class MapLogic : Shared.Models.Methods.IMapLogic public ReadOnlyDictionary GetPersonKeyToPersonContainer() { Dictionary results = []; - (); return new(results); } @@ -830,7 +829,8 @@ public partial class MapLogic : Shared.Models.Methods.IMapLogic private string? GetDisplayDirectoryName(string? displayDirectoryName, LocationContainer locationContainer, ReadOnlyDictionary personKeyToPersonContainer) { string? result = displayDirectoryName; - personKeyToPersonContainer(); + if (personKeyToPersonContainer.Count == 0) + throw new NotImplementedException(nameof(GetPersonKeyToPersonContainer)); ReadOnlyDictionary>? wholePercentagesToPersonContainers = GetWholePercentagesToPersonContainers(locationContainer.Id); if (wholePercentagesToPersonContainers is not null) { diff --git a/Metadata-Query/Metadata-Query.csproj b/Metadata-Query/Metadata-Query.csproj index 44fc628..a0957f3 100644 --- a/Metadata-Query/Metadata-Query.csproj +++ b/Metadata-Query/Metadata-Query.csproj @@ -38,7 +38,7 @@ - + diff --git a/Metadata/Metadata.csproj b/Metadata/Metadata.csproj index 6188996..46a2b01 100644 --- a/Metadata/Metadata.csproj +++ b/Metadata/Metadata.csproj @@ -34,7 +34,7 @@ - + diff --git a/Mirror-Length/Mirror-Length.csproj b/Mirror-Length/Mirror-Length.csproj index 11d9bfd..d4a7b31 100644 --- a/Mirror-Length/Mirror-Length.csproj +++ b/Mirror-Length/Mirror-Length.csproj @@ -38,7 +38,7 @@ - + diff --git a/Offset-Date-Time-Original/Offset-Date-Time-Original.csproj b/Offset-Date-Time-Original/Offset-Date-Time-Original.csproj index ddcfb62..56230b3 100644 --- a/Offset-Date-Time-Original/Offset-Date-Time-Original.csproj +++ b/Offset-Date-Time-Original/Offset-Date-Time-Original.csproj @@ -38,7 +38,7 @@ - + diff --git a/PhotoPrism/PhotoPrism.csproj b/PhotoPrism/PhotoPrism.csproj index 4b492cd..a943883 100644 --- a/PhotoPrism/PhotoPrism.csproj +++ b/PhotoPrism/PhotoPrism.csproj @@ -36,8 +36,8 @@ - - + + diff --git a/PrepareForOld/PrepareForOld.csproj b/PrepareForOld/PrepareForOld.csproj index e298c7e..10d76d3 100644 --- a/PrepareForOld/PrepareForOld.csproj +++ b/PrepareForOld/PrepareForOld.csproj @@ -35,12 +35,12 @@ - - + + - - - + + + diff --git a/Property-Compare/Property-Compare.csproj b/Property-Compare/Property-Compare.csproj index 09507fe..0e1e545 100644 --- a/Property-Compare/Property-Compare.csproj +++ b/Property-Compare/Property-Compare.csproj @@ -34,8 +34,8 @@ - - + + diff --git a/Property/Property.csproj b/Property/Property.csproj index a10f4b3..884f0e5 100644 --- a/Property/Property.csproj +++ b/Property/Property.csproj @@ -42,8 +42,8 @@ - - + + diff --git a/Rename/Rename.csproj b/Rename/Rename.csproj index f8a0063..7fb55fb 100644 --- a/Rename/Rename.csproj +++ b/Rename/Rename.csproj @@ -34,7 +34,7 @@ - + diff --git a/Resize/Resize.csproj b/Resize/Resize.csproj index 7c8e5d3..bc815ef 100644 --- a/Resize/Resize.csproj +++ b/Resize/Resize.csproj @@ -34,8 +34,8 @@ - - + + diff --git a/Shared/Models/FileHolder.cs b/Shared/Models/FileHolder.cs index 975583d..0bd86a3 100644 --- a/Shared/Models/FileHolder.cs +++ b/Shared/Models/FileHolder.cs @@ -20,33 +20,30 @@ public record FileHolder(DateTime? CreationTime, return result; } - public static FileHolder Get(FileInfo fileInfo) - { - FileHolder result; - if (!fileInfo.Exists) - result = new(null, - fileInfo.DirectoryName, - fileInfo.Exists, - fileInfo.Extension.ToLower(), - fileInfo.FullName, - null, - null, - fileInfo.Name, - Path.GetFileNameWithoutExtension(fileInfo.FullName)); - else - { - result = new(fileInfo.CreationTime, - fileInfo.DirectoryName, - fileInfo.Exists, - fileInfo.Extension.ToLower(), - fileInfo.FullName, - fileInfo.LastWriteTime, - fileInfo.Length, - fileInfo.Name, - Path.GetFileNameWithoutExtension(fileInfo.FullName)); - } - return result; - } + private static FileHolder GetExisting(FileInfo fileInfo) => + new(fileInfo.CreationTime, + fileInfo.DirectoryName, + fileInfo.Exists, + fileInfo.Extension.ToLower(), + fileInfo.FullName, + fileInfo.LastWriteTime, + fileInfo.Length, + fileInfo.Name, + Path.GetFileNameWithoutExtension(fileInfo.FullName)); + + private static FileHolder GetNonExisting(FileInfo fileInfo) => + new(null, + fileInfo.DirectoryName, + fileInfo.Exists, + fileInfo.Extension.ToLower(), + fileInfo.FullName, + null, + null, + fileInfo.Name, + Path.GetFileNameWithoutExtension(fileInfo.FullName)); + + public static FileHolder Get(FileInfo fileInfo) => + fileInfo.Exists ? GetExisting(fileInfo) : GetNonExisting(fileInfo); public static FileHolder Get(FilePath filePath) { diff --git a/Shared/Models/Stateless/Methods/IFileHolder.cs b/Shared/Models/Stateless/Methods/IFileHolder.cs index 7bac89f..feb539e 100644 --- a/Shared/Models/Stateless/Methods/IFileHolder.cs +++ b/Shared/Models/Stateless/Methods/IFileHolder.cs @@ -28,6 +28,11 @@ public interface IFileHolder static Models.FileHolder Get(string fileName) => Models.FileHolder.Get(new FileInfo(fileName)); + Models.FileHolder TestStatic_Get(FileInfo fileInfo) => + Get(fileInfo); + static Models.FileHolder Get(FileInfo fileInfo) => + Models.FileHolder.Get(fileInfo); + Models.FileHolder TestStatic_Get(FilePath filePath) => Get(filePath); static Models.FileHolder Get(FilePath filePath) => diff --git a/Shared/View-by-Distance.Shared.csproj b/Shared/View-by-Distance.Shared.csproj index 8ff10d9..bd62bb4 100644 --- a/Shared/View-by-Distance.Shared.csproj +++ b/Shared/View-by-Distance.Shared.csproj @@ -32,7 +32,7 @@ - - + + \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 15fe25d..fef1ee7 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -27,14 +27,14 @@ Linux - + - - - + + + diff --git a/TestsWithFaceRecognitionDotNet/TestsWithFaceRecognitionDotNet.csproj b/TestsWithFaceRecognitionDotNet/TestsWithFaceRecognitionDotNet.csproj index 95ee792..1b656f4 100644 --- a/TestsWithFaceRecognitionDotNet/TestsWithFaceRecognitionDotNet.csproj +++ b/TestsWithFaceRecognitionDotNet/TestsWithFaceRecognitionDotNet.csproj @@ -27,13 +27,13 @@ Linux - + - - - + + + diff --git a/ThumbHash/ThumbHash.csproj b/ThumbHash/ThumbHash.csproj index cec1f40..945a599 100644 --- a/ThumbHash/ThumbHash.csproj +++ b/ThumbHash/ThumbHash.csproj @@ -33,9 +33,9 @@ - - - + + +