Files
immich-to-slideshow/src/ImmichToSlideshow/Models/DigiKam/Images.cs
mikep@034E8FF1ED4D1F6 c4d42d79a0 DigiKam4 Archive
Change to only need the one json file and changed AppSettings to not need a binder file

Editorconfig for no new line before open braces

Nuget package bumps

Database lowest-version-history
2025-07-27 16:03:47 -07:00

28 lines
1.2 KiB
C#

using System.Collections.ObjectModel;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace ImmichToSlideshow.Models.DigiKam;
public record Images([property: JsonPropertyName("album")] int? Album,
[property: JsonPropertyName("category")] int Category,
[property: JsonPropertyName("fileSize")] object FileSize,
[property: JsonPropertyName("id")] int Id,
[property: JsonPropertyName("manualOrder")] object ManualOrder,
[property: JsonPropertyName("modificationDate")] DateTime ModificationDate,
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("status")] int Status,
[property: JsonPropertyName("uniqueHash")] string UniqueHash) {
internal static ReadOnlyCollection<Images>? GetImages(string? path) {
Images[]? results;
if (string.IsNullOrEmpty(path) || !File.Exists(path)) {
results = null;
} else {
string json = File.ReadAllText(path);
results = JsonSerializer.Deserialize<Images[]>(json);
}
return results?.AsReadOnly();
}
}