RelativePropertyCollectionFile
aMetadataCollectionDirectory Work with video FilePath.IsIgnore Removed IId IsIgnore Keywords RootAmazon SaveAmazon PhysicalFileProvider Message Bump HarFilesDirectory
This commit is contained in:
19
Shared/Models/Aggregations.cs
Normal file
19
Shared/Models/Aggregations.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Aggregations(
|
||||
[property: JsonPropertyName("allPeople")] IReadOnlyList<AllPerson> AllPeople,
|
||||
[property: JsonPropertyName("clusterId")] IReadOnlyList<ClusterId> ClusterId,
|
||||
[property: JsonPropertyName("location")] IReadOnlyList<LocationAmazon> Location,
|
||||
[property: JsonPropertyName("people")] IReadOnlyList<PersonAmazon> People,
|
||||
[property: JsonPropertyName("things")] IReadOnlyList<Thing> Things,
|
||||
[property: JsonPropertyName("time")] IReadOnlyList<Time> Time,
|
||||
[property: JsonPropertyName("type")] IReadOnlyList<Type> Type
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Aggregations))]
|
||||
public partial class AggregationsGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/AllPerson.cs
Normal file
15
Shared/Models/AllPerson.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record AllPerson(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(AllPerson))]
|
||||
public partial class AllPersonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/ClusterId.cs
Normal file
15
Shared/Models/ClusterId.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ClusterId(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ClusterId))]
|
||||
public partial class ClusterIdGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
20
Shared/Models/ContentProperties.cs
Normal file
20
Shared/Models/ContentProperties.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ContentProperties(
|
||||
[property: JsonPropertyName("contentDate")] DateTime ContentDate,
|
||||
[property: JsonPropertyName("contentSignatures")] IReadOnlyList<ContentSignature> ContentSignatures,
|
||||
[property: JsonPropertyName("contentType")] string ContentType,
|
||||
[property: JsonPropertyName("extension")] string Extension,
|
||||
[property: JsonPropertyName("image")] ImageAmazon Image,
|
||||
[property: JsonPropertyName("md5")] string Md5,
|
||||
[property: JsonPropertyName("size")] int Size,
|
||||
[property: JsonPropertyName("version")] int Version
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ContentProperties))]
|
||||
public partial class ContentPropertiesGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
14
Shared/Models/ContentSignature.cs
Normal file
14
Shared/Models/ContentSignature.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ContentSignature(
|
||||
[property: JsonPropertyName("contentSignature")] string Value,
|
||||
[property: JsonPropertyName("contentSignatureType")] string ContentSignatureType
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ContentSignature))]
|
||||
public partial class ContentSignatureGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
45
Shared/Models/Datum.cs
Normal file
45
Shared/Models/Datum.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Datum(
|
||||
[property: JsonPropertyName("accessRuleIds")] IReadOnlyList<object> AccessRuleIds,
|
||||
[property: JsonPropertyName("childAssetTypeInfo")] IReadOnlyList<object> ChildAssetTypeInfo,
|
||||
[property: JsonPropertyName("contentProperties")] ContentProperties ContentProperties,
|
||||
[property: JsonPropertyName("createdBy")] string CreatedBy,
|
||||
[property: JsonPropertyName("createdDate")] DateTime CreatedDate,
|
||||
[property: JsonPropertyName("eTagResponse")] string ETagResponse,
|
||||
[property: JsonPropertyName("groupPermissions")] IReadOnlyList<object> GroupPermissions,
|
||||
[property: JsonPropertyName("id")] string Id,
|
||||
[property: JsonPropertyName("isRoot")] bool IsRoot,
|
||||
[property: JsonPropertyName("isShared")] bool IsShared,
|
||||
[property: JsonPropertyName("keywords")] IReadOnlyList<object> Keywords,
|
||||
[property: JsonPropertyName("kind")] string Kind,
|
||||
[property: JsonPropertyName("labels")] IReadOnlyList<object> Labels,
|
||||
[property: JsonPropertyName("modifiedDate")] DateTime ModifiedDate,
|
||||
[property: JsonPropertyName("name")] string Name,
|
||||
[property: JsonPropertyName("ownerId")] string OwnerId,
|
||||
[property: JsonPropertyName("parentMap")] ParentMap ParentMap,
|
||||
[property: JsonPropertyName("parents")] IReadOnlyList<string> Parents,
|
||||
[property: JsonPropertyName("protectedFolder")] bool ProtectedFolder,
|
||||
[property: JsonPropertyName("restricted")] bool Restricted,
|
||||
[property: JsonPropertyName("status")] string Status,
|
||||
[property: JsonPropertyName("subKinds")] IReadOnlyList<object> SubKinds,
|
||||
[property: JsonPropertyName("transforms")] IReadOnlyList<string> Transforms,
|
||||
[property: JsonPropertyName("version")] int Version,
|
||||
[property: JsonPropertyName("xAccntParentMap")] XAccntParentMap XAccntParentMap,
|
||||
[property: JsonPropertyName("xAccntParents")] IReadOnlyList<object> XAccntParents,
|
||||
[property: JsonPropertyName("match")] bool? Match
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Datum))]
|
||||
public partial class DatumGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Dictionary<string, Datum>))]
|
||||
public partial class DictionaryDatumGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -45,7 +45,6 @@ public class FileHolder
|
||||
{
|
||||
if (fileInfo.Exists)
|
||||
{
|
||||
_CreationTime = fileInfo.CreationTime;
|
||||
_CreationTime = fileInfo.CreationTime;
|
||||
_LastWriteTime = fileInfo.LastWriteTime;
|
||||
_Length = fileInfo.Length;
|
||||
|
@ -10,6 +10,7 @@ public record FilePath(long CreationTicks,
|
||||
string FileNameFirstSegment,
|
||||
string FullName,
|
||||
int? Id,
|
||||
bool? IsIgnore,
|
||||
bool IsIntelligentIdFormat,
|
||||
long LastWriteTicks,
|
||||
long Length,
|
||||
@ -26,6 +27,8 @@ public record FilePath(long CreationTicks,
|
||||
|
||||
public static FilePath Get(MetadataConfiguration metadataConfiguration, FileHolder fileHolder, int? index)
|
||||
{
|
||||
if (fileHolder.CreationTime is null)
|
||||
fileHolder = new(fileHolder.FullName);
|
||||
if (fileHolder.CreationTime is null)
|
||||
throw new NullReferenceException(nameof(fileHolder.CreationTime));
|
||||
if (fileHolder.LastWriteTime is null)
|
||||
@ -38,14 +41,15 @@ public record FilePath(long CreationTicks,
|
||||
string fileNameFirstSegment = fileHolder.Name.Split('.')[0];
|
||||
int sortOrderOnlyLengthIndex = metadataConfiguration.Offset.ToString().Length;
|
||||
string fileDirectoryName = fileHolder.DirectoryName ?? throw new NullReferenceException();
|
||||
bool fileNameFirstSegmentIsIntelligentIdFormat = IId.NameWithoutExtensionIsIntelligentIdFormat(metadataConfiguration, fileNameFirstSegment);
|
||||
bool fileNameFirstSegmentIsPaddedIntelligentIdFormat = IId.NameWithoutExtensionIsPaddedIntelligentIdFormat(metadataConfiguration, sortOrderOnlyLengthIndex, fileNameFirstSegment);
|
||||
bool fileNameFirstSegmentIsIdFormat = !fileNameFirstSegmentIsPaddedIntelligentIdFormat && !fileNameFirstSegmentIsIntelligentIdFormat && IId.NameWithoutExtensionIsIdFormat(metadataConfiguration, fileHolder);
|
||||
if (!fileNameFirstSegmentIsIdFormat && !fileNameFirstSegmentIsIntelligentIdFormat && !fileNameFirstSegmentIsPaddedIntelligentIdFormat)
|
||||
bool isIntelligentIdFormat = IId.NameWithoutExtensionIsIntelligentIdFormat(metadataConfiguration, fileNameFirstSegment);
|
||||
bool isPaddedIntelligentIdFormat = IId.NameWithoutExtensionIsPaddedIntelligentIdFormat(metadataConfiguration, sortOrderOnlyLengthIndex, fileNameFirstSegment);
|
||||
bool fileNameFirstSegmentIsIdFormat = !isPaddedIntelligentIdFormat && !isIntelligentIdFormat && IId.NameWithoutExtensionIsIdFormat(metadataConfiguration, fileHolder);
|
||||
bool? isIgnore = !isIntelligentIdFormat && !isPaddedIntelligentIdFormat ? null : fileNameFirstSegment[^1] is '2' or '8';
|
||||
if (!fileNameFirstSegmentIsIdFormat && !isIntelligentIdFormat && !isPaddedIntelligentIdFormat)
|
||||
(id, sortOder) = (null, null);
|
||||
else if (fileNameFirstSegmentIsIntelligentIdFormat)
|
||||
else if (isIntelligentIdFormat)
|
||||
(id, sortOder) = (IId.GetId(metadataConfiguration, fileNameFirstSegment), null);
|
||||
else if (fileNameFirstSegmentIsPaddedIntelligentIdFormat)
|
||||
else if (isPaddedIntelligentIdFormat)
|
||||
{
|
||||
if (!int.TryParse(fileNameFirstSegment[..sortOrderOnlyLengthIndex], out int absoluteValueOfSortOrder))
|
||||
(id, sortOder) = (null, null);
|
||||
@ -68,7 +72,8 @@ public record FilePath(long CreationTicks,
|
||||
fileNameFirstSegment,
|
||||
fileHolder.FullName,
|
||||
id,
|
||||
fileNameFirstSegmentIsIntelligentIdFormat,
|
||||
isIgnore,
|
||||
isIntelligentIdFormat,
|
||||
fileHolder.LastWriteTime.Value.Ticks,
|
||||
fileHolder.Length.Value,
|
||||
fileHolder.Name,
|
||||
|
36
Shared/Models/ImageAmazon.cs
Normal file
36
Shared/Models/ImageAmazon.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ImageAmazon(
|
||||
[property: JsonPropertyName("colorSpace")] string ColorSpace,
|
||||
[property: JsonPropertyName("dateTime")] DateTime DateTime,
|
||||
[property: JsonPropertyName("dateTimeDigitized")] DateTime DateTimeDigitized,
|
||||
[property: JsonPropertyName("dateTimeOriginal")] DateTime DateTimeOriginal,
|
||||
[property: JsonPropertyName("exposureMode")] string ExposureMode,
|
||||
[property: JsonPropertyName("exposureProgram")] string ExposureProgram,
|
||||
[property: JsonPropertyName("exposureTime")] string ExposureTime,
|
||||
[property: JsonPropertyName("flash")] string Flash,
|
||||
[property: JsonPropertyName("focalLength")] string FocalLength,
|
||||
[property: JsonPropertyName("height")] int Height,
|
||||
[property: JsonPropertyName("make")] string Make,
|
||||
[property: JsonPropertyName("meteringMode")] string MeteringMode,
|
||||
[property: JsonPropertyName("model")] string Model,
|
||||
[property: JsonPropertyName("orientation")] string Orientation,
|
||||
[property: JsonPropertyName("resolutionUnit")] string ResolutionUnit,
|
||||
[property: JsonPropertyName("sensingMethod")] string SensingMethod,
|
||||
[property: JsonPropertyName("sharpness")] string Sharpness,
|
||||
[property: JsonPropertyName("software")] string Software,
|
||||
[property: JsonPropertyName("subSecTime")] string SubSecTime,
|
||||
[property: JsonPropertyName("subSecTimeDigitized")] string SubSecTimeDigitized,
|
||||
[property: JsonPropertyName("subSecTimeOriginal")] string SubSecTimeOriginal,
|
||||
[property: JsonPropertyName("whiteBalance")] string WhiteBalance,
|
||||
[property: JsonPropertyName("width")] int Width,
|
||||
[property: JsonPropertyName("apertureValue")] string ApertureValue
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ImageAmazon))]
|
||||
public partial class ImageAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/LocationAmazon.cs
Normal file
15
Shared/Models/LocationAmazon.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record LocationAmazon(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(LocationAmazon))]
|
||||
public partial class LocationAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
17
Shared/Models/LocationInfo.cs
Normal file
17
Shared/Models/LocationInfo.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record LocationInfo(
|
||||
[property: JsonPropertyName("city")] string City,
|
||||
[property: JsonPropertyName("country")] string Country,
|
||||
[property: JsonPropertyName("countryIso3Code")] string CountryIso3Code,
|
||||
[property: JsonPropertyName("state")] string State,
|
||||
[property: JsonPropertyName("stateCode")] string StateCode
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(LocationInfo))]
|
||||
public partial class LocationInfoGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
25
Shared/Models/MappingFromFilter.cs
Normal file
25
Shared/Models/MappingFromFilter.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record MappingFromFilter(bool? IsFocusModel,
|
||||
bool? IsFocusPerson,
|
||||
bool? IsFocusRelativePath,
|
||||
bool? InSkipCollection,
|
||||
bool? IsUsed)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, MappingFromFilterGenerationContext.Default.MappingFromFilter);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(MappingFromFilter))]
|
||||
public partial class MappingFromFilterGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
13
Shared/Models/ParentMap.cs
Normal file
13
Shared/Models/ParentMap.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record ParentMap(
|
||||
[property: JsonPropertyName("FOLDER")] IReadOnlyList<string> FOLDER
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(ParentMap))]
|
||||
public partial class ParentMapGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/PersonAmazon.cs
Normal file
15
Shared/Models/PersonAmazon.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record PersonAmazon(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(PersonAmazon))]
|
||||
public partial class PersonAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/RootAmazon.cs
Normal file
15
Shared/Models/RootAmazon.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record RootAmazon(
|
||||
[property: JsonPropertyName("aggregations")] Aggregations Aggregations,
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("data")] IReadOnlyList<Datum> Data
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(RootAmazon))]
|
||||
public partial class RootAmazonGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
16
Shared/Models/SearchData.cs
Normal file
16
Shared/Models/SearchData.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record SearchData(
|
||||
[property: JsonPropertyName("clusterName")] string ClusterName,
|
||||
[property: JsonPropertyName("locationId")] string LocationId,
|
||||
[property: JsonPropertyName("locationInfo")] LocationInfo LocationInfo,
|
||||
[property: JsonPropertyName("thingId")] string ThingId
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(SearchData))]
|
||||
public partial class SearchDataGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
@ -35,7 +35,7 @@ internal abstract class Id
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetIntelligentId(MetadataConfiguration metadataConfiguration, long id, bool ignore)
|
||||
internal static string GetIntelligentId(MetadataConfiguration metadataConfiguration, long id, bool? ignore)
|
||||
{
|
||||
string result;
|
||||
StringBuilder stringBuilder = new();
|
||||
@ -46,12 +46,12 @@ internal abstract class Id
|
||||
List<char> resultAllInOneSubdirectoryChars = [];
|
||||
if (id > -1)
|
||||
{
|
||||
key = ignore ? 8 : 9;
|
||||
key = ignore is not null && ignore.Value ? 8 : 9;
|
||||
value = id.ToString().PadLeft(metadataConfiguration.IntMinValueLength, '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
key = ignore ? 2 : 1;
|
||||
key = ignore is not null && ignore.Value ? 2 : 1;
|
||||
value = id.ToString()[1..].PadLeft(metadataConfiguration.IntMinValueLength, '0');
|
||||
}
|
||||
for (int i = value.Length - metadataConfiguration.ResultConfiguration.ResultAllInOneSubdirectoryLength - 1; i > -1; i--)
|
||||
@ -62,14 +62,19 @@ internal abstract class Id
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetPaddedId(MetadataConfiguration metadataConfiguration, int index, int id)
|
||||
internal static string GetPaddedId(MetadataConfiguration metadataConfiguration, int id, bool? ignore, int? index)
|
||||
{
|
||||
string result;
|
||||
string intelligentId = GetIntelligentId(metadataConfiguration, id, ignore: false);
|
||||
int check = GetId(metadataConfiguration, intelligentId);
|
||||
if (check != id)
|
||||
throw new NotSupportedException();
|
||||
result = $"{metadataConfiguration.Offset + index}{intelligentId}";
|
||||
if (metadataConfiguration.Offset < 0)
|
||||
result = Guid.NewGuid().ToString();
|
||||
else
|
||||
{
|
||||
string intelligentId = GetIntelligentId(metadataConfiguration, id, ignore);
|
||||
int check = GetId(metadataConfiguration, intelligentId);
|
||||
if (check != id)
|
||||
throw new NotSupportedException();
|
||||
result = index is null || metadataConfiguration.Offset == 9876543 ? intelligentId : $"{metadataConfiguration.Offset + index}{intelligentId}";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,10 @@ public interface IId
|
||||
static int GetId(MetadataConfiguration metadataConfiguration, string intelligentId) =>
|
||||
Id.GetId(metadataConfiguration, intelligentId);
|
||||
|
||||
string TestStatic_GetPaddedId(MetadataConfiguration metadataConfiguration, int index, int id) =>
|
||||
GetPaddedId(metadataConfiguration, index, id);
|
||||
static string GetPaddedId(MetadataConfiguration metadataConfiguration, int index, int id) =>
|
||||
Id.GetPaddedId(metadataConfiguration, index, id);
|
||||
|
||||
bool TestStatic_IsIgnore(FilePath filePath) =>
|
||||
IsIgnore(filePath);
|
||||
static bool IsIgnore(FilePath filePath) =>
|
||||
filePath.FileNameFirstSegment[^1] is '2' or '8';
|
||||
string TestStatic_GetPaddedId(MetadataConfiguration metadataConfiguration, int id, bool? ignore, int? index) =>
|
||||
GetPaddedId(metadataConfiguration, id, ignore, index);
|
||||
static string GetPaddedId(MetadataConfiguration metadataConfiguration, int id, bool? ignore, int? index) =>
|
||||
Id.GetPaddedId(metadataConfiguration, id, ignore, index);
|
||||
|
||||
string TestStatic_GetIgnoreFullPath(FilePath filePath, FileHolder fileHolder) =>
|
||||
GetIgnoreFullPath(filePath, fileHolder);
|
||||
|
@ -6,7 +6,7 @@ namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
public interface IRename
|
||||
{
|
||||
|
||||
(ReadOnlyCollection<string>, FilePath?) ConvertAndGetFfmpegFiles(IRenameConfiguration renameConfiguration, FilePath filePath);
|
||||
ReadOnlyCollection<string> ConvertAndGetFfmpegFiles(IRenameConfiguration renameConfiguration, FilePath filePath);
|
||||
DeterministicHashCode GetDeterministicHashCode(FilePath filePath);
|
||||
void Tick();
|
||||
|
||||
|
@ -67,12 +67,20 @@ internal abstract class XDate
|
||||
foreach (QuickTimeMovieHeaderDirectory quickTimeMovieHeaderDirectory in exifDirectory.QuickTimeMovieHeaderDirectories)
|
||||
{
|
||||
if (quickTimeMovieHeaderDirectory.Created is not null)
|
||||
{
|
||||
if (quickTimeMovieHeaderDirectory.Created.Value.Year == 1904 && quickTimeMovieHeaderDirectory.Created.Value.Month == 1 && quickTimeMovieHeaderDirectory.Created.Value.Day == 1)
|
||||
continue;
|
||||
results.Add(quickTimeMovieHeaderDirectory.Created.Value);
|
||||
}
|
||||
}
|
||||
foreach (QuickTimeTrackHeaderDirectory quickTimeTrackHeaderDirectory in exifDirectory.QuickTimeTrackHeaderDirectories)
|
||||
{
|
||||
if (quickTimeTrackHeaderDirectory.Created is not null)
|
||||
{
|
||||
if ((quickTimeTrackHeaderDirectory.Created.Value.Year is 1904 or 1970) && quickTimeTrackHeaderDirectory.Created.Value.Month == 1 && quickTimeTrackHeaderDirectory.Created.Value.Day == 1)
|
||||
continue;
|
||||
results.Add(quickTimeTrackHeaderDirectory.Created.Value);
|
||||
}
|
||||
}
|
||||
result = results.Count == 0 ? null : results.Min();
|
||||
return result;
|
||||
@ -146,12 +154,20 @@ internal abstract class XDate
|
||||
foreach (QuickTimeMovieHeaderDirectory quickTimeMovieHeaderDirectory in exifDirectory.QuickTimeMovieHeaderDirectories)
|
||||
{
|
||||
if (quickTimeMovieHeaderDirectory.Created is not null)
|
||||
{
|
||||
if (quickTimeMovieHeaderDirectory.Created.Value.Year == 1904 && quickTimeMovieHeaderDirectory.Created.Value.Month == 1 && quickTimeMovieHeaderDirectory.Created.Value.Day == 1)
|
||||
continue;
|
||||
results.Add(quickTimeMovieHeaderDirectory.Created.Value);
|
||||
}
|
||||
}
|
||||
foreach (QuickTimeTrackHeaderDirectory quickTimeTrackHeaderDirectory in exifDirectory.QuickTimeTrackHeaderDirectories)
|
||||
{
|
||||
if (quickTimeTrackHeaderDirectory.Created is not null)
|
||||
{
|
||||
if ((quickTimeTrackHeaderDirectory.Created.Value.Year is 1904 or 1970) && quickTimeTrackHeaderDirectory.Created.Value.Month == 1 && quickTimeTrackHeaderDirectory.Created.Value.Day == 1)
|
||||
continue;
|
||||
results.Add(quickTimeTrackHeaderDirectory.Created.Value);
|
||||
}
|
||||
}
|
||||
if (results.Count == 0)
|
||||
{
|
||||
|
15
Shared/Models/Thing.cs
Normal file
15
Shared/Models/Thing.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Thing(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Thing))]
|
||||
public partial class ThingGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/Time.cs
Normal file
15
Shared/Models/Time.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Time(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Time))]
|
||||
public partial class TimeGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
15
Shared/Models/Type.cs
Normal file
15
Shared/Models/Type.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record Type(
|
||||
[property: JsonPropertyName("count")] int Count,
|
||||
[property: JsonPropertyName("match")] string Match,
|
||||
[property: JsonPropertyName("searchData")] SearchData SearchData
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Type))]
|
||||
public partial class TypeGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
13
Shared/Models/XAccntParentMap.cs
Normal file
13
Shared/Models/XAccntParentMap.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record XAccntParentMap(
|
||||
|
||||
);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(XAccntParentMap))]
|
||||
public partial class XAccntParentMapGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user