@ -16,6 +16,7 @@ using View_by_Distance.Property.Models;
using View_by_Distance.Resize.Models ;
using View_by_Distance.Shared.Models ;
using View_by_Distance.Shared.Models.Methods ;
using View_by_Distance.Shared.Models.Stateless.Methods ;
using WindowsShortcutFactory ;
namespace View_by_Distance.Instance ;
@ -126,9 +127,9 @@ public partial class DlibDotNet
string peopleRootDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( propertyConfiguration , nameof ( A2_People ) ) ;
string? rootResultsDirectory = Path . GetDirectoryName ( Path . GetDirectoryName ( peopleRootDirectory ) ) ? ? throw new Exception ( ) ;
Storage storage = new ( rootDirectory , rootResultsDirectory , peopleRootDirectory ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( peopleRootDirectory , "{}" ) ) ;
( _GenealogicalDataCommunicationHeaderLines , Dictionary < string , List < string > > individuals , _GenealogicalDataCommunicationFooterLines ) = Shared . Models . Stateless . Methods . IGenealogicalDataCommunication. GetIndividuals ( configuration . GenealogicalDataCommunicationFile , requireNickName : true ) ;
_PersonContainers = Shared . Models . Stateless . Methods . IPersonContainer. GetPersonContainers ( storage , configuration . MappingDefaultName , configuration . PersonBirthdayFormat , configuration . PersonCharacters . ToArray ( ) , _Faces . FileNameExtension , individuals ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( peopleRootDirectory , _Configuration . PropertyConfiguration . ResultSingleton ) ) ;
( _GenealogicalDataCommunicationHeaderLines , Dictionary < string , List < string > > individuals , _GenealogicalDataCommunicationFooterLines ) = IGenealogicalDataCommunication . GetIndividuals ( configuration . GenealogicalDataCommunicationFile , requireNickName : true ) ;
_PersonContainers = IPersonContainer . GetPersonContainers ( storage , configuration . MappingDefaultName , configuration . PersonBirthdayFormat , configuration . PersonCharacters . ToArray ( ) , _Faces . FileNameExtension , individuals ) ;
VerifyPersonContainersDisplayDirectoryAllFiles ( ) ;
}
{
@ -321,9 +322,9 @@ public partial class DlibDotNet
eyeα = α is null ? null : ( int ) Math . Round ( Math . Abs ( α . Value ) ) ;
}
confidencePercent = Shared . Models . Stateless . Methods . ILocation . GetConfidencePercent ( _Configuration . FaceConfidencePercent , _Configuration . RangeFaceConfidence , face . Location . Confidence ) ;
faceAreaPermyriad = Shared . Models . Stateless . Methods . IMapping. GetAreaPermyriad ( _Configuration . FaceAreaPermyriad , face . Location , face . OutputResolution ) ;
faceAreaPermyriad = IMapping . GetAreaPermyriad ( _Configuration . FaceAreaPermyriad , face . Location , face . OutputResolution ) ;
wholePercentRectangle = Shared . Models . Stateless . Methods . ILocation . GetWholePercentages ( face . Location , Shared . Models . Stateless . ILocation . Digits , face . OutputResolution ) ;
deterministicHashCodeKey = Shared . Models . Stateless . Methods . IMapping. GetDeterministicHashCodeKey ( item . Property . Id . Value , face . Location , Shared . Models . Stateless . ILocation . Digits , face . OutputResolution ) ;
deterministicHashCodeKey = IMapping . GetDeterministicHashCodeKey ( item . Property . Id . Value , face . Location , Shared . Models . Stateless . ILocation . Digits , face . OutputResolution ) ;
mappingFromLocation = new ( faceAreaPermyriad , confidencePercent , deterministicHashCodeKey , eyeα , eyeReview , wholePercentRectangle ) ;
inSkipCollection = mapLogic . InSkipCollection ( item . Property . Id . Value , mappingFromLocation ) ;
mappingFromFilter = new ( isFocusModel , isFocusRelativePath , isIgnoreRelativePath , inSkipCollection ) ;
@ -356,7 +357,7 @@ public partial class DlibDotNet
else
{
wholePercentRectangle = Shared . Models . Stateless . Methods . ILocation . GetWholePercentages ( Shared . Models . Stateless . ILocation . Digits ) ;
deterministicHashCodeKey = Shared . Models . Stateless . Methods . IMapping. GetDeterministicHashCodeKey ( item . Property . Id . Value , Shared . Models . Stateless . ILocation . Digits ) ;
deterministicHashCodeKey = IMapping . GetDeterministicHashCodeKey ( item . Property . Id . Value , Shared . Models . Stateless . ILocation . Digits ) ;
mappingFromLocation = new ( faceAreaPermyriad , confidencePercent , deterministicHashCodeKey , eyeα , eyeReview , wholePercentRectangle ) ;
inSkipCollection = mapLogic . InSkipCollection ( item . Property . Id . Value , mappingFromLocation ) ;
mappingFromFilter = new ( isFocusModel , isFocusRelativePath , isIgnoreRelativePath , inSkipCollection ) ;
@ -413,12 +414,13 @@ public partial class DlibDotNet
List < string > parseExceptions = new ( ) ;
List < Tuple < string , DateTime > > subFileTuples = new ( ) ;
List < KeyValuePair < string , string > > metadataCollection ;
string [ ] changesFrom = new string [ ] { nameof ( A_Property ) } ;
FileHolder resizedFileHolder = _Resize . GetResizedFileHolder ( cResultsFullGroupDirectory , item , outputResolutionHasNumber ) ;
if ( item . Property is null | | item . Property . Id is null | | item . Any ( ) )
{
LogItemPropertyIsNull ( item ) ;
int? propertyHashCode = item . Property ? . GetHashCode ( ) ;
property = propertyLogic . GetProperty ( item , subFileTuples , parseExceptions ) ;
property = propertyLogic . GetProperty ( metadata , item, subFileTuples , parseExceptions ) ;
item . Update ( property ) ;
if ( propertyHashCode is null )
{
@ -438,9 +440,13 @@ public partial class DlibDotNet
subFileTuples . Add ( new Tuple < string , DateTime > ( nameof ( A_Property ) , item . SourceDirectoryFileHolder . LastWriteTime . Value ) ) ;
else
subFileTuples . Add ( new Tuple < string , DateTime > ( nameof ( A_Property ) , new FileInfo ( item . SourceDirectoryFileHolder . FullName ) . LastWriteTime ) ) ;
int sortOrderOnlyLengthIndex = IDirectory . GetSortOrderOnlyLengthIndex ( ) ;
bool nameWithoutExtensionIsIdFormat = Shared . Models . Stateless . Methods . IProperty . NameWithoutExtensionIsIdFormat ( item . ImageFileHolder ) ;
bool nameWithoutExtensionIsPaddedIdFormat = IDirectory . NameWithoutExtensionIsPaddedIdFormat ( item . ImageFileHolder , sortOrderOnlyLengthIndex ) ;
if ( nameWithoutExtensionIsIdFormat & & item . ImageFileHolder . NameWithoutExtension ! = item . Property . Id . ToString ( ) )
LogNameWithoutExtensionIsIdFormatBut ( item ) ;
if ( nameWithoutExtensionIsPaddedIdFormat & & item . ImageFileHolder . NameWithoutExtension . EndsWith ( item . Property . Id . Value . ToString ( ) [ 1. . ] ) )
LogNameWithoutExtensionIsIdFormatBut ( item ) ;
if ( _BlurHasher is not null & & resizedFileHolder . Exists & & item . Property . Width is not null & & item . Property . Width . Value > 4 & & _Configuration . SaveBlurHashForOutputResolutions . Contains ( outputResolution ) )
{
string? file = _BlurHasher . GetFile ( resizedFileHolder ) ;
@ -451,8 +457,8 @@ public partial class DlibDotNet
if ( property is null | | item . Property is null )
throw new NullReferenceException ( nameof ( property ) ) ;
item . SetResizedFileHolder ( _Resize . FileNameExtension , resizedFileHolder ) ;
MappingFromItem mappingFromItem = Shared . Models . Stateless . Methods . IMappingFromItem. GetMappingFromItem ( containerDateTimes , item , resizedFileHolder ) ;
( int metadataGroups , metadataCollection ) = metadata . GetMetadataCollection ( subFileTuples , parseExceptions , mappingFromItem ) ;
MappingFromItem mappingFromItem = IMappingFromItem . GetMappingFromItem ( containerDateTimes , item , resizedFileHolder ) ;
( int metadataGroups , metadataCollection ) = metadata . GetMetadataCollection ( subFileTuples , parseExceptions , changesFrom , mappingFromItem ) ;
if ( _AppSettings . MaxDegreeOfParallelism < 2 )
ticks = LogDelta ( ticks , nameof ( B_Metadata . GetMetadataCollection ) ) ;
Dictionary < string , int [ ] > outputResolutionToResize = _Resize . GetResizeKeyValuePairs ( _Configuration . PropertyConfiguration , cResultsFullGroupDirectory , subFileTuples , parseExceptions , metadataCollection , item . Property , mappingFromItem ) ;
@ -794,10 +800,10 @@ public partial class DlibDotNet
private void MapLogic ( long ticks , Container [ ] containers , string a2PeopleSingletonDirectory , string dResultsFullGroupDirectory , string d2ResultsFullGroupDirectory , string fPhotoPrismContentDirectory , MapLogic mapLogic , string outputResolution , Dictionary < long , List < int > > personKeyToIds , List < Shared . Models . Face > distinctFilteredFaces , Mapping [ ] distinctFilteredMappingCollection , int totalNotMapped )
{
string dFacesContentDirectory = Path . Combine ( dResultsFullGroupDirectory , "()" ) ;
string d2FacePartsContentDirectory = Path . Combine ( d2ResultsFullGroupDirectory , "()" ) ;
string dFacesContentDirectory = Path . Combine ( dResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultContent ) ;
string d2FacePartsContentDirectory = Path . Combine ( d2ResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultContent ) ;
string d2FacePartsContentCollectionDirectory = Path . Combine ( d2ResultsFullGroupDirectory , "[()]" ) ;
string dFacesCollectionDirectory = Path . Combine ( dResultsFullGroupDirectory , "[]" , _Configuration . PropertyConfiguration . ResultAllInOne ) ;
string dFacesCollectionDirectory = Path . Combine ( dResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultCollection , _Configuration . PropertyConfiguration . ResultAllInOne ) ;
if ( distinctFilteredMappingCollection . Any ( ) )
{
Shared . Models . Stateless . Methods . IPath . ChangeDateForEmptyDirectories ( d2FacePartsContentDirectory , ticks ) ;
@ -871,24 +877,29 @@ public partial class DlibDotNet
private static void LookForAbandoned ( List < int > distinctFilteredIds , string directory , string directoryName )
{
string fileNameWithoutExtension ;
bool nameWithoutExtensionIsIdFormat ;
List < string > renameCollection = new ( ) ;
bool nameWithoutExtensionIsPaddedIdFormat ;
int sortOrderOnlyLengthIndex = IDirectory . GetSortOrderOnlyLengthIndex ( ) ;
string [ ] distinctFilteredIdsValues = distinctFilteredIds . Select ( l = > l . ToString ( ) ) . ToArray ( ) ;
string [ ] files = Directory . GetFiles ( directory , "*" , SearchOption . AllDirectories ) ;
foreach ( string file in files )
{
fileNameWithoutExtension = Path . GetFileNameWithoutExtension ( Path . GetFileNameWithoutExtension ( Path . GetFileNameWithoutExtension ( file ) ) ) ;
if ( distinctFilteredIdsValues . Contains ( fileNameWithoutExtension ) )
nameWithoutExtensionIsIdFormat = Shared . Models . Stateless . Methods . IProperty . NameWithoutExtensionIsIdFormat ( fileNameWithoutExtension ) ;
nameWithoutExtensionIsPaddedIdFormat = IDirectory . NameWithoutExtensionIsPaddedIdFormat ( fileNameWithoutExtension , sortOrderOnlyLengthIndex ) ;
if ( ! nameWithoutExtensionIsIdFormat & & ! nameWithoutExtensionIsPaddedIdFormat )
continue ;
if ( ! Shared . Models . Stateless . Methods . IProperty . NameWithoutExtensionIsIdFormat ( fileNameWithoutExtension ) )
if ( distinctFilteredIdsValues . Contains ( fileNameWithoutExtension ) )
continue ;
renameCollection . Add ( file ) ;
}
if ( renameCollection . Any ( ) )
{
if ( directoryName . Length = = 2 )
Shared . Models . Stateless . Methods . IDirectory. MoveFiles ( renameCollection , directoryName , $"{directoryName[0]}abd{directoryName[^1]}" ) ;
IDirectory . MoveFiles ( renameCollection , directoryName , $"{directoryName[0]}abd{directoryName[^1]}" ) ;
else if ( directoryName . Length = = 4 )
Shared . Models . Stateless . Methods . IDirectory. MoveFiles ( renameCollection , directoryName , $"{directoryName[..2]}abd{directoryName[^2..]}" ) ;
IDirectory . MoveFiles ( renameCollection , directoryName , $"{directoryName[..2]}abd{directoryName[^2..]}" ) ;
else
throw new NotSupportedException ( ) ;
}
@ -906,7 +917,7 @@ public partial class DlibDotNet
}
}
private static void LookForAbandoned ( ReadOnlyDictionary < int , List < LocationContainer < MetadataExtractor . Directory > > > idToLocationContainers , List < int > distinctFilteredIds )
private void LookForAbandoned ( ReadOnlyDictionary < int , List < LocationContainer < MetadataExtractor . Directory > > > idToLocationContainers , List < int > distinctFilteredIds )
{
List < string > renameCollection = new ( ) ;
foreach ( KeyValuePair < int , List < LocationContainer < MetadataExtractor . Directory > > > keyValuePair in idToLocationContainers )
@ -921,7 +932,7 @@ public partial class DlibDotNet
}
}
if ( renameCollection . Any ( ) )
Shared . Models . Stateless . Methods . IDirectory. MoveFiles ( renameCollection , "()" , "(abd)" ) ;
IDirectory . MoveFiles ( renameCollection , _Configuration . PropertyConfiguration . ResultContent , "(abd)" ) ;
}
private void LookForAbandoned ( string bResultsFullGroupDirectory , Container [ ] containers , ReadOnlyDictionary < int , List < LocationContainer < MetadataExtractor . Directory > > > idToLocationContainers )
@ -994,7 +1005,7 @@ public partial class DlibDotNet
{
if ( item . Property ? . Id is null | | item . ResizedFileHolder is null )
continue ;
mappingFromItem = Shared . Models . Stateless . Methods . IMappingFromItem. GetMappingFromItem ( containerDateTimes , item , item . ResizedFileHolder ) ;
mappingFromItem = IMappingFromItem . GetMappingFromItem ( containerDateTimes , item , item . ResizedFileHolder ) ;
if ( distinctItems )
{
if ( distinct . Contains ( item . Property . Id . Value ) )
@ -1137,6 +1148,7 @@ public partial class DlibDotNet
private void Search ( long ticks , string argZero , string propertyRoot )
{
int t ;
int count ;
string message ;
Container [ ] containers ;
A_Property propertyLogic ;
@ -1151,26 +1163,53 @@ public partial class DlibDotNet
string fPhotoPrismContentDirectory ;
const string fileSearchFilter = "*" ;
string fPhotoPrismSingletonDirectory ;
bool filesCollectionCountIsOne = false ;
List < string [ ] > ? filesCollection = null ;
const string directorySearchFilter = "*" ;
Dictionary < long , List < int > > personKeyToIds ;
bool eLastWriteTimeTimeSpanIsMoreThen = false ;
Dictionary < int , List < MappingFromPhotoPrism > > fileNameToCollection ;
( aResultsFullGroupDirectory , bResultsFullGroupDirectory ) = GetResultsFullGroupDirectories ( ) ;
ProgressBarOptions options = new ( ) { ProgressCharacter = '─' , ProgressBarOnBottom = true , DisableBottomPercentage = true } ;
string a2PeopleSingleton Directory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( A2_People ) , "{}" ) ;
a2PeopleContentDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( A2_People ) , "([])" ) ;
eDistanceContentDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( E_Distance ) , "()" ) ;
fPhotoPrismContentDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( F_PhotoPrism ) , "()" ) ;
fPhotoPrismSingletonDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( F_PhotoPrism ) , "{}" ) ;
propertyLogic = new ( _AppSettings . MaxDegreeOfParallelism , _Configuration . PropertyConfiguration , _Resize . FileNameExtension , _Configuration . Reverse , aResultsFullGroupDirectory ) ;
List < string [ ] > filesCollection = Shared . Models . Stateless . Methods . IDirectory . GetFilesCollection ( _Configuration . PropertyConfiguration . RootDirectory , directorySearchFilter , fileSearchFilter ) ;
int count = filesCollection . Select ( l = > l . Length ) . Sum ( ) ;
if ( filesCollection . Count = = 1 )
eDistanceContent Directory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( E_Distance ) , _Configuration . PropertyConfiguration . ResultContent ) ;
TimeSpan eLastWriteTimeTimeSpan = new ( ticks - new DirectoryInfo ( eDistanceContentDirectory ) . LastWriteTime . Ticks ) ;
foreach ( string outputResolution in _Configuration . OutputResolutions )
{
if ( outputResolution . Any ( l = > char . IsNumber ( l ) ) )
continue ;
eLastWriteTimeTimeSpanIsMoreThen = true ;
if ( eLastWriteTimeTimeSpan . TotalDays < 1 )
break ;
ProgressBar progressBar ;
( cResultsFullGroupDirectory , _ , _ , _ ) = GetResultsFullGroupDirectories ( outputResolution ) ;
IReadOnlyDictionary < string , string [ ] > fileGroups = Shared . Models . Stateless . Methods . IPath . GetKeyValuePairs ( _Configuration . PropertyConfiguration , cResultsFullGroupDirectory , new string [ ] { _Configuration . PropertyConfiguration . ResultContent } ) ;
filesCollection = IDirectory . GetFilesCollection ( _Configuration . PropertyConfiguration . RootDirectory , directorySearchFilter , fileSearchFilter ) ;
message = $") Selecting for ## pattern directory - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)" ;
count = filesCollection . Select ( l = > l . Length ) . Sum ( ) ;
filesCollectionCountIsOne = filesCollection . Count = = 1 ;
progressBar = new ( count , message , options ) ;
( string [ ] distinctDirectories , List < ( FileHolder , string ) > toDoCollection ) = IDirectory . GetToDoCollection ( _Configuration . PropertyConfiguration , filesCollection , fileGroups [ _Configuration . PropertyConfiguration . ResultContent ] , ( ) = > progressBar . Tick ( ) ) ;
progressBar . Dispose ( ) ;
message = $") Copying to ## pattern directory - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)" ;
progressBar = new ( count , message , options ) ;
_ = IDirectory . CopyOrMove ( toDoCollection , move : false , moveBack : false , ( ) = > progressBar . Tick ( ) ) ;
progressBar . Dispose ( ) ;
break ;
}
a2PeopleContentDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( A2_People ) , "([])" ) ;
fPhotoPrismContentDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( F_PhotoPrism ) , _Configuration . PropertyConfiguration . ResultContent ) ;
fPhotoPrismSingletonDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( F_PhotoPrism ) , _Configuration . PropertyConfiguration . ResultSingleton ) ;
string a2PeopleSingletonDirectory = Property . Models . Stateless . IResult . GetResultsDateGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( A2_People ) , _Configuration . PropertyConfiguration . ResultSingleton ) ;
propertyLogic = new ( _AppSettings . MaxDegreeOfParallelism , _Configuration . PropertyConfiguration , _Resize . FileNameExtension , _Configuration . Reverse , aResultsFullGroupDirectory ) ;
if ( filesCollectionCountIsOne )
{
if ( filesCollection is null )
throw new NullReferenceException ( nameof ( filesCollection ) ) ;
string resultsGroupDirectory ;
a2PeopleContentDirectory = null ;
eDistanceContentDirectory = Path . Combine ( $"{Path.GetPathRoot(argZero)}" , "()" ) ;
fPhotoPrismContentDirectory = Path . Combine ( $"{Path.GetPathRoot(argZero)}" , "()" ) ;
fPhotoPrismSingletonDirectory = Path . Combine ( $"{Path.GetPathRoot(argZero)}" , "{}" ) ;
eDistanceContentDirectory = Path . Combine ( $"{Path.GetPathRoot(argZero)}" , _Configuration . PropertyConfiguration . ResultContent ) ;
fPhotoPrismContentDirectory = Path . Combine ( $"{Path.GetPathRoot(argZero)}" , _Configuration . PropertyConfiguration . ResultContent ) ;
fPhotoPrismSingletonDirectory = Path . Combine ( $"{Path.GetPathRoot(argZero)}" , _Configuration . PropertyConfiguration . ResultSingleton ) ;
for ( int i = 1 ; i < 10 ; i + + )
{
resultsGroupDirectory = Property . Models . Stateless . IResult . GetResultsGroupDirectory ( _Configuration . PropertyConfiguration , string . Empty , create : true ) ;
@ -1182,31 +1221,25 @@ public partial class DlibDotNet
propertyRoot = Property . Models . Stateless . IResult . GetResultsGroupDirectory ( _Configuration . PropertyConfiguration , nameof ( A_Property ) , create : false ) ;
propertyLogic = new ( _AppSettings . MaxDegreeOfParallelism , _Configuration . PropertyConfiguration , _Resize . FileNameExtension , _Configuration . Reverse , aResultsFullGroupDirectory ) ;
}
TimeSpan eLastWriteTimeTimeSpan = new ( ticks - new DirectoryInfo ( eDistanceContentDirectory ) . LastWriteTime . Ticks ) ;
foreach ( string outputResolution in _Configuration . OutputResolutions )
if ( eLastWriteTimeTimeSpanIsMoreThen )
{
if ( outputResolution . Any ( l = > char . IsNumber ( l ) ) )
continue ;
if ( eLastWriteTimeTimeSpan . TotalDays < 1 )
foreach ( string outputResolution in _Configuration . OutputResolutions )
{
if ( outputResolution . Any ( l = > char . IsNumber ( l ) ) )
continue ;
( cResultsFullGroupDirectory , _ , _ , _ ) = GetResultsFullGroupDirectories ( outputResolution ) ;
filesCollection = IDirectory . GetFilesCollection ( Path . Combine ( cResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultContent , _Configuration . PropertyConfiguration . ResultAllInOne ) , directorySearchFilter , fileSearchFilter ) ;
count = filesCollection . Select ( l = > l . Length ) . Sum ( ) ;
break ;
ProgressBar progressBar ;
( cResultsFullGroupDirectory , _ , _ , _ ) = GetResultsFullGroupDirectories ( outputResolution ) ;
IReadOnlyDictionary < string , string [ ] > fileGroups = Shared . Models . Stateless . Methods . IPath . GetKeyValuePairs ( _Configuration . PropertyConfiguration , cResultsFullGroupDirectory , new string [ ] { _Configuration . PropertyConfiguration . ResultContent } ) ;
message = $") Selecting for ## pattern directory - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)" ;
progressBar = new ( count , message , options ) ;
( string [ ] distinctDirectories , List < ( FileHolder , string ) > toDoCollection ) = Shared . Models . Stateless . Methods . IDirectory . GetToDoCollection ( _Configuration . PropertyConfiguration , copyDuplicates : false , filesCollection , fileGroups [ _Configuration . PropertyConfiguration . ResultContent ] , ( ) = > progressBar . Tick ( ) ) ;
progressBar . Dispose ( ) ;
message = $") Copying to ## pattern directory - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)" ;
progressBar = new ( count , message , options ) ;
_ = Shared . Models . Stateless . Methods . IDirectory . CopyOrMove ( toDoCollection , move : false , moveBack : false , ( ) = > progressBar . Tick ( ) ) ;
progressBar . Dispose ( ) ;
break ;
}
}
if ( filesCollection is null )
throw new NullReferenceException ( nameof ( filesCollection ) ) ;
message = $") Building Container(s) - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)" ;
using ( ProgressBar progressBar = new ( 2 , message , options ) )
{
progressBar . Tick ( ) ;
string aPropertySingletonDirectory = Path . Combine ( aResultsFullGroupDirectory , "{}" ) ;
string aPropertySingletonDirectory = Path . Combine ( aResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultSingleton ) ;
if ( ! Directory . Exists ( aPropertySingletonDirectory ) )
_ = Directory . CreateDirectory ( aPropertySingletonDirectory ) ;
( t , containers ) = Shared . Models . Stateless . Methods . IContainer . GetContainers ( _Configuration . PropertyConfiguration , aPropertySingletonDirectory , filesCollection ) ;
@ -1215,11 +1248,11 @@ public partial class DlibDotNet
fileNameToCollection = ! Directory . Exists ( fPhotoPrismSingletonDirectory ) ? fileNameToCollection = new ( ) : F_PhotoPrism . GetFileNameToCollection ( fPhotoPrismSingletonDirectory ) ;
B_Metadata metadata = new ( _Configuration . PropertyConfiguration , _Configuration . ForceMetadataLastWriteTimeToCreationTime , _Configuration . PropertiesChangedForMetadata , bResultsFullGroupDirectory ) ;
MapLogic mapLogic = new ( _AppSettings . MaxDegreeOfParallelism , _Configuration . PropertyConfiguration , _MapConfiguration , new ( _PersonContainers ) , ticks , a2PeopleSingletonDirectory , eDistanceContentDirectory ) ;
_PersonContainers . AddRange ( Shared . Models . Stateless . Methods . IPersonContainer. GetNonSpecificPeopleCollection ( _Configuration . MappingDefaultName , _Configuration . PersonBirthdayFirstYear , _Configuration . PersonCharacters . ToArray ( ) , _PersonContainers , ticks ) ) ;
_PersonContainers . AddRange ( IPersonContainer . GetNonSpecificPeopleCollection ( _Configuration . MappingDefaultName , _Configuration . PersonBirthdayFirstYear , _Configuration . PersonCharacters . ToArray ( ) , _PersonContainers , ticks ) ) ;
containers = Shared . Models . Stateless . Methods . IContainer . SortContainers ( _Configuration . PropertyConfiguration , _Configuration . IgnoreRelativePaths , _ArgZeroIsConfigurationRootDirectory , argZero , containers ) ;
personKeyToIds = mapLogic . GetPersonKeyToIds ( ) ;
if ( ! string . IsNullOrEmpty ( _Configuration . GenealogicalDataCommunicationFile ) & & ! string . IsNullOrEmpty ( a2PeopleContentDirectory ) & & _GenealogicalDataCommunicationHeaderLines is not null & & _GenealogicalDataCommunicationFooterLines is not null & & _GenealogicalDataCommunicationHeaderLines . Any ( ) & & _GenealogicalDataCommunicationFooterLines . Any ( ) )
Shared . Models . Stateless . Methods . IGenealogicalDataCommunication. CreateTree ( _Configuration . MappingDefaultName , _Configuration . PersonBirthdayFormat , _Configuration . PropertyConfiguration . ResultAllInOne , _PersonContainers , _GenealogicalDataCommunicationHeaderLines , _GenealogicalDataCommunicationFooterLines , ticks , a2PeopleContentDirectory , personKeyToIds ) ;
IGenealogicalDataCommunication . CreateTree ( _Configuration . MappingDefaultName , _Configuration . PersonBirthdayFormat , _Configuration . PropertyConfiguration . ResultAllInOne , _PersonContainers , _GenealogicalDataCommunicationHeaderLines , _GenealogicalDataCommunicationFooterLines , ticks , a2PeopleContentDirectory , personKeyToIds ) ;
ReadOnlyDictionary < int , List < LocationContainer < MetadataExtractor . Directory > > > idToLocationContainers = mapLogic . GetIdToLocationContainers ( ) ;
FullDoWork ( argZero , propertyRoot , ticks , aResultsFullGroupDirectory , bResultsFullGroupDirectory , t , containers , propertyLogic , metadata , fileNameToCollection , idToLocationContainers , mapLogic ) ;
if ( _Configuration . LookForAbandoned )
@ -1257,11 +1290,11 @@ public partial class DlibDotNet
continue ;
if ( ! _IsEnvironment . Development )
{
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( aResultsFullGroupDirectory , "{}" ) ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( bResultsFullGroupDirectory , "{}" ) ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( cResultsFullGroupDirectory , "{}" ) ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( aResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultSingleton ) ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( bResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultSingleton ) ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( cResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultSingleton ) ) ;
if ( _Configuration . LoadOrCreateThenSaveImageFacesResultsForOutputResolutions . Contains ( outputResolution ) )
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( dResultsFullGroupDirectory , "[]" ) ) ;
_ = Shared . Models . Stateless . Methods . IPath . DeleteEmptyDirectories ( Path . Combine ( dResultsFullGroupDirectory , _Configuration . PropertyConfiguration . ResultCollection ) ) ;
}
}
}