From 93987468e2d4b4d5996e92425a18a9c3ecfc1c1c Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Wed, 22 Jul 2026 20:23:21 +1200 Subject: [PATCH] Add ShowPeopleAge setting to show a person's age in the people description --- .../Interfaces/IClientSettings.cs | 1 + .../Resources/TestV1.json | 1 + .../Resources/TestV2.json | 1 + ImmichFrame.WebApi.Tests/Resources/TestV2.yml | 1 + .../Helpers/Config/ServerSettingsV1.cs | 2 ++ .../Models/ClientSettingsDto.cs | 1 + ImmichFrame.WebApi/Models/ServerSettings.cs | 1 + Install_Web.md | 1 + docker/Settings.example.json | 1 + docker/Settings.example.yml | 1 + docker/example.env | 1 + docs/docs/getting-started/configuration.md | 2 ++ docs/docs/getting-started/configurationV1.md | 1 + .../elements/asset-component.svelte | 5 +++++ .../lib/components/elements/asset-info.svelte | 19 ++++++++++++++++--- .../src/lib/components/elements/asset.svelte | 3 +++ .../lib/components/home-page/home-page.svelte | 1 + immichFrame.Web/src/lib/immichFrameApi.ts | 1 + openApi/swagger.json | 3 +++ 19 files changed, 44 insertions(+), 3 deletions(-) diff --git a/ImmichFrame.Core/Interfaces/IClientSettings.cs b/ImmichFrame.Core/Interfaces/IClientSettings.cs index 576c13eb..c40a49dc 100644 --- a/ImmichFrame.Core/Interfaces/IClientSettings.cs +++ b/ImmichFrame.Core/Interfaces/IClientSettings.cs @@ -14,6 +14,7 @@ public interface IClientSettings public string? PhotoDateFormat { get; } public bool ShowImageDesc { get; } public bool ShowPeopleDesc { get; } + public bool ShowPeopleAge { get; } public bool ShowTagsDesc { get; } public bool ShowAlbumName { get; } public bool ShowImageLocation { get; } diff --git a/ImmichFrame.WebApi.Tests/Resources/TestV1.json b/ImmichFrame.WebApi.Tests/Resources/TestV1.json index e6c49102..750450d3 100644 --- a/ImmichFrame.WebApi.Tests/Resources/TestV1.json +++ b/ImmichFrame.WebApi.Tests/Resources/TestV1.json @@ -43,6 +43,7 @@ "PhotoDateFormat": "PhotoDateFormat_TEST", "ShowImageDesc": true, "ShowPeopleDesc": true, + "ShowPeopleAge": true, "ShowImageLocation": true, "ImageLocationFormat": "ImageLocationFormat_TEST", "PrimaryColor": "PrimaryColor_TEST", diff --git a/ImmichFrame.WebApi.Tests/Resources/TestV2.json b/ImmichFrame.WebApi.Tests/Resources/TestV2.json index 4d603dc9..3850556f 100644 --- a/ImmichFrame.WebApi.Tests/Resources/TestV2.json +++ b/ImmichFrame.WebApi.Tests/Resources/TestV2.json @@ -23,6 +23,7 @@ "ShowPhotoDate": true, "ShowImageDesc": true, "ShowPeopleDesc": true, + "ShowPeopleAge": true, "ShowAlbumName": true, "ShowImageLocation": true, "PrimaryColor": "PrimaryColor_TEST", diff --git a/ImmichFrame.WebApi.Tests/Resources/TestV2.yml b/ImmichFrame.WebApi.Tests/Resources/TestV2.yml index 47f45947..0a13f180 100644 --- a/ImmichFrame.WebApi.Tests/Resources/TestV2.yml +++ b/ImmichFrame.WebApi.Tests/Resources/TestV2.yml @@ -22,6 +22,7 @@ General: ShowPhotoDate: true ShowImageDesc: true ShowPeopleDesc: true + ShowPeopleAge: true ShowAlbumName: true ShowImageLocation: true PrimaryColor: PrimaryColor_TEST diff --git a/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs b/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs index 076f36da..ae8c1113 100644 --- a/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs +++ b/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs @@ -41,6 +41,7 @@ public class ServerSettingsV1 : IConfigSettable public string? PhotoDateFormat { get; set; } = "MM/dd/yyyy"; public bool ShowImageDesc { get; set; } = true; public bool ShowPeopleDesc { get; set; } = true; + public bool ShowPeopleAge { get; set; } = false; public bool ShowTagsDesc { get; set; } = true; public bool ShowAlbumName { get; set; } = true; public bool ShowImageLocation { get; set; } = true; @@ -119,6 +120,7 @@ class GeneralSettingsV1Adapter(ServerSettingsV1 _delegate) : IGeneralSettings public string? PhotoDateFormat => _delegate.PhotoDateFormat; public bool ShowImageDesc => _delegate.ShowImageDesc; public bool ShowPeopleDesc => _delegate.ShowPeopleDesc; + public bool ShowPeopleAge => _delegate.ShowPeopleAge; public bool ShowTagsDesc => _delegate.ShowTagsDesc; public bool ShowAlbumName => _delegate.ShowAlbumName; public bool ShowImageLocation => _delegate.ShowImageLocation; diff --git a/ImmichFrame.WebApi/Models/ClientSettingsDto.cs b/ImmichFrame.WebApi/Models/ClientSettingsDto.cs index 5e408fe9..ecb8cbc9 100644 --- a/ImmichFrame.WebApi/Models/ClientSettingsDto.cs +++ b/ImmichFrame.WebApi/Models/ClientSettingsDto.cs @@ -16,6 +16,7 @@ public class ClientSettingsDto(IClientSettings settings) : IClientSettings public string? PhotoDateFormat => settings.PhotoDateFormat; public bool ShowImageDesc => settings.ShowImageDesc; public bool ShowPeopleDesc => settings.ShowPeopleDesc; + public bool ShowPeopleAge => settings.ShowPeopleAge; public bool ShowTagsDesc => settings.ShowTagsDesc; public bool ShowAlbumName => settings.ShowAlbumName; public bool ShowImageLocation => settings.ShowImageLocation; diff --git a/ImmichFrame.WebApi/Models/ServerSettings.cs b/ImmichFrame.WebApi/Models/ServerSettings.cs index 74d0fb8e..ea0dd8f2 100644 --- a/ImmichFrame.WebApi/Models/ServerSettings.cs +++ b/ImmichFrame.WebApi/Models/ServerSettings.cs @@ -50,6 +50,7 @@ public class GeneralSettings : IGeneralSettings, IConfigSettable public bool ShowPhotoDate { get; set; } = true; public bool ShowImageDesc { get; set; } = true; public bool ShowPeopleDesc { get; set; } = true; + public bool ShowPeopleAge { get; set; } = false; public bool ShowTagsDesc { get; set; } = true; public bool ShowAlbumName { get; set; } = true; public bool ShowImageLocation { get; set; } = true; diff --git a/Install_Web.md b/Install_Web.md index 5cf3f94c..67016225 100644 --- a/Install_Web.md +++ b/Install_Web.md @@ -67,6 +67,7 @@ services: # PhotoDateFormat: "yyyy-MM-dd" # ShowImageDesc: "true" # ShowPeopleDesc: "true" + # ShowPeopleAge: "false" # ShowAlbumName: "true" # ShowImageLocation: "true" # ImageLocationFormat: "City,State,Country" diff --git a/docker/Settings.example.json b/docker/Settings.example.json index a86a4d00..aea9f583 100644 --- a/docker/Settings.example.json +++ b/docker/Settings.example.json @@ -23,6 +23,7 @@ "ShowPhotoDate": true, "ShowImageDesc": true, "ShowPeopleDesc": true, + "ShowPeopleAge": false, "ShowAlbumName": true, "ShowImageLocation": true, "PrimaryColor": "#f5deb3", diff --git a/docker/Settings.example.yml b/docker/Settings.example.yml index 173b31a5..716ba56c 100644 --- a/docker/Settings.example.yml +++ b/docker/Settings.example.yml @@ -21,6 +21,7 @@ General: ShowPhotoDate: true ShowImageDesc: true ShowPeopleDesc: true + ShowPeopleAge: false ShowAlbumName: true ShowImageLocation: true PrimaryColor: '#f5deb3' diff --git a/docker/example.env b/docker/example.env index 51d80ed5..89fedd22 100644 --- a/docker/example.env +++ b/docker/example.env @@ -34,6 +34,7 @@ ApiKey=KEY # PhotoDateFormat=yyyy-MM-dd # ShowImageDesc=true # ShowPeopleDesc=true +# ShowPeopleAge=false # ShowAlbumName=true # ShowImageLocation=true # ImageLocationFormat=City,State,Country diff --git a/docs/docs/getting-started/configuration.md b/docs/docs/getting-started/configuration.md index 7378c7d1..ae20028b 100644 --- a/docs/docs/getting-started/configuration.md +++ b/docs/docs/getting-started/configuration.md @@ -76,6 +76,8 @@ General: ShowImageDesc: true # boolean # Displays a comma separated list of names of all the people that are assigned in immich. ShowPeopleDesc: true # boolean + # Appends each person's age at the time the photo was taken in brackets, e.g. "John (7)". Requires ShowPeopleDesc and a birthday set in immich. + ShowPeopleAge: false # boolean # Displays a comma separated list of names of all the tags that are assigned in immich. ShowTagsDesc: true # boolean # Displays a comma separated list of names of all the albums for an image. diff --git a/docs/docs/getting-started/configurationV1.md b/docs/docs/getting-started/configurationV1.md index bf9ca932..6842c1f9 100644 --- a/docs/docs/getting-started/configurationV1.md +++ b/docs/docs/getting-started/configurationV1.md @@ -41,6 +41,7 @@ sidebar_position: 4 | [Calendar](#calendar) | Webcalendars | string[] | [] | A list of webcalendar URIs in the .ics format. e.g. https://calendar.google.com/calendar/ical/XXXXXX/public/basic.ics | | [Metadata](#metadata) | ShowImageDesc | boolean | true | Displays the description of the current image. | | [Metadata](#metadata) | ShowPeopleDesc | boolean | true | Displays a comma separated list of names of all the people that are assigned in immich. | +| [Metadata](#metadata) | ShowPeopleAge | boolean | false | Appends each person's age at the time the photo was taken in brackets, e.g. "John (7)". Requires ShowPeopleDesc and a birthday in immich. | | [Metadata](#metadata) | ShowAlbumName | boolean | true | Displays a comma separated list of names of all the albums for an image. | | [Metadata](#metadata) | ShowImageLocation | boolean | true | Displays the location of the current image. | | [Metadata](#metadata) | ImageLocationFormat | string | City,State,Country | | diff --git a/immichFrame.Web/src/lib/components/elements/asset-component.svelte b/immichFrame.Web/src/lib/components/elements/asset-component.svelte index 13ed3901..b5602479 100644 --- a/immichFrame.Web/src/lib/components/elements/asset-component.svelte +++ b/immichFrame.Web/src/lib/components/elements/asset-component.svelte @@ -23,6 +23,7 @@ showPhotoDate?: boolean; showImageDesc?: boolean; showPeopleDesc?: boolean; + showPeopleAge?: boolean; showTagsDesc?: boolean; showAlbumName?: boolean; imageFill?: boolean; @@ -46,6 +47,7 @@ showPhotoDate = true, showImageDesc = true, showPeopleDesc = true, + showPeopleAge = false, showTagsDesc = true, showAlbumName = true, imageFill = false, @@ -112,6 +114,7 @@ {showPhotoDate} {showImageDesc} {showPeopleDesc} + {showPeopleAge} {showTagsDesc} {showAlbumName} {imageFill} @@ -134,6 +137,7 @@ {showPhotoDate} {showImageDesc} {showPeopleDesc} + {showPeopleAge} {showTagsDesc} {showAlbumName} {imageFill} @@ -158,6 +162,7 @@ {showPhotoDate} {showImageDesc} {showPeopleDesc} + {showPeopleAge} {showTagsDesc} {showAlbumName} {imageFill} diff --git a/immichFrame.Web/src/lib/components/elements/asset-info.svelte b/immichFrame.Web/src/lib/components/elements/asset-info.svelte index a3aa3885..edb32990 100644 --- a/immichFrame.Web/src/lib/components/elements/asset-info.svelte +++ b/immichFrame.Web/src/lib/components/elements/asset-info.svelte @@ -1,6 +1,6 @@ {#if showPhotoDate || showLocation || showImageDesc || showPeopleDesc || showTagsDesc || showAlbumName} @@ -99,7 +112,7 @@ {#if showPeopleDesc && availablePeople && availablePeople.length > 0}

- {availablePeople.map((x) => x.name).join(', ')} + {availablePeople.map(formatPerson).join(', ')}

{/if} {#if showTagsDesc && availableTags && availableTags.length > 0} diff --git a/immichFrame.Web/src/lib/components/elements/asset.svelte b/immichFrame.Web/src/lib/components/elements/asset.svelte index 7df465b8..9e7d8230 100644 --- a/immichFrame.Web/src/lib/components/elements/asset.svelte +++ b/immichFrame.Web/src/lib/components/elements/asset.svelte @@ -22,6 +22,7 @@ showPhotoDate: boolean; showImageDesc: boolean; showPeopleDesc: boolean; + showPeopleAge: boolean; showTagsDesc: boolean; showAlbumName: boolean; imageFill: boolean; @@ -42,6 +43,7 @@ showPhotoDate, showImageDesc, showPeopleDesc, + showPeopleAge, showTagsDesc, showAlbumName, imageFill, @@ -289,6 +291,7 @@ {showPhotoDate} {showImageDesc} {showPeopleDesc} + {showPeopleAge} {showTagsDesc} {showAlbumName} {split} diff --git a/immichFrame.Web/src/lib/components/home-page/home-page.svelte b/immichFrame.Web/src/lib/components/home-page/home-page.svelte index fa91b97e..922c241b 100644 --- a/immichFrame.Web/src/lib/components/home-page/home-page.svelte +++ b/immichFrame.Web/src/lib/components/home-page/home-page.svelte @@ -505,6 +505,7 @@ showPhotoDate={$configStore.showPhotoDate} showImageDesc={$configStore.showImageDesc} showPeopleDesc={$configStore.showPeopleDesc} + showPeopleAge={$configStore.showPeopleAge} showTagsDesc={$configStore.showTagsDesc} showAlbumName={$configStore.showAlbumName} {...assetsState} diff --git a/immichFrame.Web/src/lib/immichFrameApi.ts b/immichFrame.Web/src/lib/immichFrameApi.ts index 85fa762b..f5a39832 100644 --- a/immichFrame.Web/src/lib/immichFrameApi.ts +++ b/immichFrame.Web/src/lib/immichFrameApi.ts @@ -212,6 +212,7 @@ export type ClientSettingsDto = { photoDateFormat?: string | null; showImageDesc?: boolean; showPeopleDesc?: boolean; + showPeopleAge?: boolean; showTagsDesc?: boolean; showAlbumName?: boolean; showImageLocation?: boolean; diff --git a/openApi/swagger.json b/openApi/swagger.json index 9569c297..07059ca3 100644 --- a/openApi/swagger.json +++ b/openApi/swagger.json @@ -1037,6 +1037,9 @@ "showPeopleDesc": { "type": "boolean" }, + "showPeopleAge": { + "type": "boolean" + }, "showTagsDesc": { "type": "boolean" },