Skip to content

Commit 1e02536

Browse files
authored
Merge pull request #521 from damongolding/chore/better-field-alignment
Chore/better field alignment
2 parents a0d8cdb + a549bc8 commit 1e02536

File tree

13 files changed

+288
-256
lines changed

13 files changed

+288
-256
lines changed

config.schema.json

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
"type": "boolean"
1818
},
1919
"time_format": {
20-
"type": ["integer", "string"]
20+
"oneOf": [
21+
{ "type": "string", "enum": ["12", "24"] },
22+
{ "type": "integer", "enum": [12, 24] }
23+
],
24+
"examples": ["12", "24"]
2125
},
2226
"show_date": {
2327
"type": "boolean"
@@ -47,7 +51,8 @@
4751
"type": ["string", "array"],
4852
"items": {
4953
"type": "string"
50-
}
54+
},
55+
"uniqueItems": true
5156
},
5257
"require_all_people": {
5358
"type": "boolean"
@@ -56,13 +61,15 @@
5661
"type": ["string", "array"],
5762
"items": {
5863
"type": "string"
59-
}
64+
},
65+
"uniqueItems": true
6066
},
6167
"albums": {
6268
"type": ["string", "array"],
6369
"items": {
6470
"type": "string"
65-
}
71+
},
72+
"uniqueItems": true
6673
},
6774
"album_video": {
6875
"type": "boolean"
@@ -74,19 +81,22 @@
7481
"type": ["string", "array"],
7582
"items": {
7683
"type": "string"
77-
}
84+
},
85+
"uniqueItems": true
7886
},
7987
"dates": {
8088
"type": ["string", "array"],
8189
"items": {
8290
"type": "string"
83-
}
91+
},
92+
"uniqueItems": true
8493
},
8594
"tags": {
8695
"type": ["string", "array"],
8796
"items": {
8897
"type": "string"
89-
}
98+
},
99+
"uniqueItems": true
90100
},
91101
"memories": {
92102
"type": "boolean"
@@ -200,7 +210,11 @@
200210
"type": "boolean"
201211
},
202212
"image_time_format": {
203-
"type": ["integer", "string"]
213+
"oneOf": [
214+
{ "type": "string", "enum": ["12", "24"] },
215+
{ "type": "integer", "enum": [12, 24] }
216+
],
217+
"examples": ["12", "24"]
204218
},
205219
"show_image_date": {
206220
"type": "boolean"
@@ -224,7 +238,8 @@
224238
"type": ["string", "array"],
225239
"items": {
226240
"type": "string"
227-
}
241+
},
242+
"uniqueItems": true
228243
},
229244
"show_image_id": {
230245
"type": "boolean"
@@ -242,13 +257,15 @@
242257
"type": ["string", "array"],
243258
"items": {
244259
"type": "string"
245-
}
260+
},
261+
"uniqueItems": true
246262
},
247263
"hide_button_action": {
248264
"type": ["string", "array"],
249265
"items": {
250266
"type": "string"
251-
}
267+
},
268+
"uniqueItems": true
252269
},
253270
"weather": {
254271
"type": "array",
@@ -307,13 +324,15 @@
307324
"type": "array",
308325
"items": {
309326
"type": "string"
310-
}
327+
},
328+
"uniqueItems": true
311329
},
312330
"iframe": {
313331
"type": ["string", "array"],
314332
"items": {
315333
"type": "string"
316-
}
334+
},
335+
"uniqueItems": true
317336
},
318337
"immich_users_api_keys": {
319338
"type": "object",
@@ -329,7 +348,8 @@
329348
"type": ["string", "array"],
330349
"items": {
331350
"type": "string"
332-
}
351+
},
352+
"uniqueItems": true
333353
},
334354
"show_user": {
335355
"type": "boolean"
@@ -373,9 +393,9 @@
373393
},
374394
"config_validation_level": {
375395
"type": "string",
376-
"enum": ["warning", "error"],
396+
"enum": ["warning", "error", "off"],
377397
"default": "error",
378-
"description": "Controls how invalid configuration is handled. 'warning' logs a warning and continues; 'error' treats invalid configuration as fatal."
398+
"description": "Controls how invalid configuration is handled. 'warning' logs a warning and continues; 'error' treats invalid configuration as fatal; 'off' disables validation checks."
379399
},
380400
"port": {
381401
"type": "integer"
@@ -387,7 +407,9 @@
387407
"type": "boolean"
388408
},
389409
"fetched_assets_size": {
390-
"type": "integer"
410+
"type": "integer",
411+
"minimum": 1,
412+
"maximum": 1000
391413
},
392414
"http_timeout": {
393415
"type": "integer"

internal/common/common.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ func (c *Common) Secret() string {
7676

7777
// RouteRequestData contains request metadata and configuration used across routes
7878
type RouteRequestData struct {
79-
RequestConfig config.Config // Configuration for the current request
8079
DeviceID string // Unique identifier for the device making the request
8180
RequestID string // Unique identifier for this specific request
8281
ClientName string // Name of the client making the request
82+
RequestConfig config.Config // Configuration for the current request
8383
}
8484

8585
// ViewImageData contains the image data and metadata for displaying an image in the view
8686
type ViewImageData struct {
87-
ImmichAsset immich.Asset // ImmichAsset contains immich asset data
8887
ImageData string // ImageData contains the image as base64 data
8988
ImageBlurData string // ImageBlurData contains the blurred image as base64 data
90-
ImageDominantColor color.RGBA // ImageDominantColor contains the dominant color of the image
9189
ImageDate string // ImageDate contains the date of the image
9290
User string // User the user api key used
91+
ImmichAsset immich.Asset // ImmichAsset contains immich asset data
92+
ImageDominantColor color.RGBA // ImageDominantColor contains the dominant color of the image
9393
}
9494

9595
// ViewData contains all the data needed to render a view in the application
@@ -104,17 +104,17 @@ type ViewData struct {
104104
}
105105

106106
type ViewImageDataOptions struct {
107-
RelativeAssetWanted bool
108107
RelativeAssetBucket kiosk.Source
109108
RelativeAssetBucketID string
110109
ImageOrientation immich.ImageOrientation
110+
RelativeAssetWanted bool
111111
}
112112

113113
// ContextCopy stores a copy of key HTTP context information including URL and headers
114114
type ContextCopy struct {
115-
URL url.URL // The request URL
116115
RequestHeader http.Header // Headers from the incoming request
117116
ResponseHeader http.Header // Headers for the outgoing response
117+
URL url.URL // The request URL
118118
}
119119

120120
// CopyContext creates a copy of essential context data from an echo.Context

0 commit comments

Comments
 (0)