PhotoPrism for more locations

This commit is contained in:
2022-12-25 13:54:17 -07:00
parent a510019c1d
commit 37c7b6760d
31 changed files with 395 additions and 509 deletions

View File

@ -333,7 +333,7 @@ public class A_Property
json = JsonSerializer.Serialize(result, _WriteIndentedJsonSerializerOptions);
if (populateId && Shared.Models.Stateless.Methods.IPath.WriteAllText(fileInfo.FullName, json, updateDateWhenMatches: true, compareBeforeWrite: true))
{
if (!_Configuration.ForcePropertyLastWriteTimeToCreationTime && (!fileInfo.Exists || fileInfo.LastWriteTime == fileInfo.CreationTime))
if (!_Configuration.ForcePropertyLastWriteTimeToCreationTime)
sourceDirectoryFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Property), DateTime.Now));
else
{

View File

@ -16,7 +16,7 @@ public class Configuration
[Display(Name = "Ignore Extensions"), Required] public string[] IgnoreExtensions { get; set; }
[Display(Name = "Max Images In Directory For Top Level First Pass"), Required] public int? MaxImagesInDirectoryForTopLevelFirstPass { get; set; }
[Display(Name = "Pattern"), Required] public string Pattern { get; set; }
[Display(Name = "Populate Properties Id"), Required] public bool? PopulatePropertyId { get; set; }
[Display(Name = "Populate Properties FileId"), Required] public bool? PopulatePropertyId { get; set; }
[Display(Name = "Properties Changed For Property"), Required] public bool? PropertiesChangedForProperty { get; set; }
[Display(Name = "Property Content Collection Files"), Required] public string[] PropertyContentCollectionFiles { get; set; }
[Display(Name = "Result All In One"), Required] public string ResultAllInOne { get; set; }

View File

@ -216,6 +216,7 @@ public class Container
{
string relativePath;
string checkFileName;
string? checkDirectoryName;
List<string> checkCollection = new();
checkCollection.AddRange(otherCollection);
int length = configuration.RootDirectory.Length;
@ -225,6 +226,9 @@ public class Container
{
relativePath = Shared.Models.Stateless.Methods.IPath.GetRelativePath(fileHolder.FullName, length);
checkFileName = Path.GetFullPath(string.Concat(aPropertySingletonDirectory, relativePath));
checkDirectoryName = Path.GetDirectoryName(checkFileName);
if (string.IsNullOrEmpty(checkDirectoryName) || !Directory.Exists(checkDirectoryName))
continue;
if (!checkCollection.Remove(checkFileName))
File.WriteAllText(checkFileName, string.Empty);
}