mirror of
https://github.com/immich-app/immich.git
synced 2026-09-30 13:23:21 +08:00
chore(server): use bounded numbers in workflows (#29009)
* chore(server): use bounded numbers in workflows * chore: increase precision for lat/lon filtering * chore: re-add integer to a json schema type
This commit is contained in:
@@ -163,19 +163,26 @@
|
||||
"description": "Filter by distance to a coordinate",
|
||||
"properties": {
|
||||
"latitude": {
|
||||
"type": "string",
|
||||
"type": "number",
|
||||
"title": "Latitude",
|
||||
"description": "GPS latitude of a coordinate which the asset must be close to"
|
||||
"description": "GPS latitude of a coordinate which the asset must be close to",
|
||||
"minimum": -90,
|
||||
"maximum": 90,
|
||||
"precision": 0.000001
|
||||
},
|
||||
"longitude": {
|
||||
"type": "string",
|
||||
"type": "number",
|
||||
"title": "Longitude",
|
||||
"description": "GPS longitude of a coordinate which the asset must be close to"
|
||||
"description": "GPS longitude of a coordinate which the asset must be close to",
|
||||
"minimum": -180,
|
||||
"maximum": 180,
|
||||
"precision": 0.000001
|
||||
},
|
||||
"radius": {
|
||||
"type": "number",
|
||||
"title": "Maximum distance",
|
||||
"description": "How close in kilometres the asset must be to the given point"
|
||||
"description": "How close in kilometres the asset must be to the given point",
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ const methods = wrapper<Manifest>({
|
||||
return { workflow: { continue: false } };
|
||||
}
|
||||
|
||||
const configLat = Number.parseFloat(config.coordinate?.latitude ?? '');
|
||||
const configLon = Number.parseFloat(config.coordinate?.longitude ?? '');
|
||||
const configLat = config.coordinate?.latitude;
|
||||
const configLon = config.coordinate?.longitude;
|
||||
|
||||
if (Number.isNaN(configLat) || Number.isNaN(configLat)) {
|
||||
if (configLat === undefined || configLon === undefined) {
|
||||
return { workflow: { continue: true } };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user