fix: recognize displayed terminal versions and clean obsolete gallery remnants
Community checks / verify (push) Skipped
Verify Frame Flow / verify (push) Failing after 11m49s

This commit is contained in:
渡口浪人
2026-10-23 22:57:53 +08:00
parent 64bd8dd736
commit 30bc5a0bad
19 changed files with 606 additions and 68 deletions
+2
View File
@@ -1,5 +1,7 @@
# Synology NAS deployment / 群晖部署
当前生产服务已迁至 Ubuntu Server(参见 `scripts/server-release.py`)。以下内容仅适用于自行选择群晖容器部署的安装,不代表当前生产环境。
Target: DS923+, DSM 7.4.1 (verified on target; originally specified 7.3.1), AMD64, Container Manager.
Directory: /volume2/docker/pigway-frame-flow. Default published port: 6005.
The container still listens on 18787; Compose maps host 6005 to container 18787.
+1 -1
View File
@@ -25,7 +25,7 @@
每份成品关联源画面、方案 ID 和生成时的完整参数快照。相同源画面和相同参数复用已有版本;修改方案后重新生成产生新版本,不覆盖历史图片。任务持久保存选图和方案快照,进程中断后继续处理该画面,不重新随机选图或重复提交同一终端输出。
相框通过现有上传队列和设备确认流程传输;“已生成”“待推送”“等待设备确认”“已确认显示”分别记录。来源任务完成代表生成和提交完成,不代表所有终端已显示;具体结果看终端图库的独立操作。手表当前只生成 410×502 成品,传输尚未接入。某个方案生成失败不撤销其他输出,源画面保留,可以单独重新生成或重新推送失败目标。
相框通过现有上传队列和设备确认流程传输;“已生成”“待推送”“等待设备确认”“已确认显示”分别记录。来源任务完成代表生成和提交完成,不代表所有终端已显示;具体结果看终端图库的独立操作。终端当前画面已同步确认且关联到该成品时,推送按钮显示“已在终端显示”并禁用;仅有历史推送成功记录不足以认定当前仍在显示,离线或同步状态未知时也不作该判断。手表当前只生成 410×502 成品,传输尚未接入。某个方案生成失败不撤销其他输出,源画面保留,可以单独重新生成或重新推送失败目标。
在来源图库手动点击“随机选入并按绑定生成”只生成,不自动推送。终端图库的相框推送需要明确点击并确认,受全局设备写入开关约束。更换终端绑定后,尚未执行的旧版本推送会在设备写入前重新校验,不符合当前绑定时停止。
-23
View File
@@ -1,23 +0,0 @@
# 小图方案(兼容入口)
主界面已采用[来源图库、生成方案与终端](SOURCE_LIBRARIES.md)。本文描述保留的旧版小图 API 与历史入口;新方案应在对应来源图库中建立,终端单选来源及其方案。
平台侧边栏的“小图方案”提供方案新增、查看、修改与删除。每个方案可保存名称、输出宽高(16–2048 像素)、JPEG 质量(40–95)、适配方式及水平/垂直裁切位置(0–1)。默认 410×502、质量 85、居中等比裁切铺满,不拉伸、不补黑边。也可主动选择完整画面,此时必要处补白;裁切位置仅用于铺满模式。
选择照片数据源及源图片后,可以使用当前参数预览或“生成并保存到图库”。预览不保存文件,正式生成沿用同一渲染器,结果在本地图库按既有方式查看、下载与删除。修改参数后须重新预览;保存方案与保存生成图片是独立操作。
自动化任务提供“生成小图”勾选,默认关闭。勾选后必须单选一个已保存方案,仅支持照片数据源任务。画框上传成功后,按所选方案生成小图;计划执行时使用该方案最新保存的参数。正在被任务或待处理操作引用的方案不能删除,请先取消任务勾选或更换方案。已有任务默认保持不生成小图;手动照片上传沿用原有默认小图行为。
小图始终使用添加画框说明前的源画面,不叠加日期、文字或边框,不修改源文件。Synology Photos 当前只能提供源预览,不称为原图。没有可验证源画面的模板和旧图库成品不生成。
成功操作结果的 `wrist_thumbnail` 包含鉴权资源 URL、方案 ID 及参数、尺寸、字节数、SHA-256、生成时间、服务器配置时区及当地日期。`app_config` 的 `wrist-thumbnail:<device_id>` 保存该设备最后一次成功生成的记录;跨日不将旧图冒充当天图片。资源沿用 `/api/v1/assets/{asset_id}` 的鉴权规则。
方案接口为 `/api/v1/thumbnail-plans` 和 `/{plan_id}`;预览及生成分别使用 `/api/v1/thumbnails/preview` 与 `/generate`。读取和预览需要 `images:read`,写入需要 `admin`。参数由服务端校验,任务提交也校验方案存在性与来源类型。
上传失败不更新小图。辅助小图生成失败保留已有记录并记录日志,不重放已成功的画框上传。最新小图受现有本地清理策略保护,较早小图沿用 cache 清理策略。本阶段未接入 BLE、手表端下载或实机显示验证。
## 手表小图图库
图库新增“手表 · 小图图库”标签,顶部设备选择器也提供“手表 · 410×502”,选择后进入该图库。手表是独立逻辑设备,传输状态明确为尚未接入,不会把小图发送到现有画框。图库支持分页、预览、下载、删除,并展示尺寸、生成方案和时间。“小图方案”页生成后可直接跳转查看。
手动生成与任务生成的小图都按专用元数据归入该图库,从普通本地图库中分离;图像资源继续使用原有鉴权和删除接口。删除最新小图时同时清除对应的最新记录,不影响源照片。历史自动小图按操作回执或最新记录恢复分类,不会根据文件名、尺寸猜测普通图片。旧版手动生成的小图缺少可靠分类信息,仍在原本地图库。
+500
View File
@@ -19133,6 +19133,506 @@
}
}
}
},
"/api/v1/source-libraries/{source_id}/browse": {
"get": {
"summary": "Browse",
"operationId": "browse_api_v1_source_libraries__source_id__browse_get",
"security": [
{
"HTTPBearer": []
},
{
"AccountSession": []
}
],
"parameters": [
{
"name": "source_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Source Id"
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 10000000,
"minimum": 0,
"default": 0,
"title": "Offset"
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 60,
"minimum": 1,
"default": 36,
"title": "Limit"
}
},
{
"name": "filename",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"default": "",
"title": "Filename"
}
},
{
"name": "folder",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 500,
"default": "",
"title": "Folder"
}
},
{
"name": "min_bytes",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"default": 0,
"title": "Min Bytes"
}
},
{
"name": "max_bytes",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "integer",
"maximum": 1000000000000,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Max Bytes"
}
},
{
"name": "min_width",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 100000,
"minimum": 0,
"default": 0,
"title": "Min Width"
}
},
{
"name": "max_width",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "integer",
"maximum": 100000,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Max Width"
}
},
{
"name": "min_height",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 100000,
"minimum": 0,
"default": 0,
"title": "Min Height"
}
},
{
"name": "max_height",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "integer",
"maximum": 100000,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Max Height"
}
},
{
"name": "date_from",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "date"
},
{
"type": "null"
}
],
"title": "Date From"
}
},
{
"name": "date_to",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string",
"format": "date"
},
{
"type": "null"
}
],
"title": "Date To"
}
},
{
"name": "date_field",
"in": "query",
"required": false,
"schema": {
"enum": [
"time",
"indexed_time"
],
"type": "string",
"default": "indexed_time",
"title": "Date Field"
}
},
{
"name": "person_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "integer",
"minimum": 1
},
{
"type": "null"
}
],
"title": "Person Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Request"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Unauthorized"
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Forbidden"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Not Found"
},
"409": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Conflict"
},
"413": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Content Too Large"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Unprocessable Content"
},
"429": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Too Many Requests"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Internal Server Error"
},
"502": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Gateway"
},
"503": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Service Unavailable"
}
}
}
},
"/api/v1/source-libraries/{source_id}/browse/{item_id}/preview": {
"get": {
"summary": "Browse Preview",
"operationId": "browse_preview_api_v1_source_libraries__source_id__browse__item_id__preview_get",
"security": [
{
"HTTPBearer": []
},
{
"AccountSession": []
}
],
"parameters": [
{
"name": "source_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Source Id"
}
},
{
"name": "item_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Item Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Request"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Unauthorized"
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Forbidden"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Not Found"
},
"409": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Conflict"
},
"413": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Content Too Large"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Unprocessable Content"
},
"429": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Too Many Requests"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Internal Server Error"
},
"502": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Gateway"
},
"503": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Service Unavailable"
}
}
}
}
},
"components": {