feat(product-suite): refine history account filters
This commit is contained in:
+4
-1
@@ -368,6 +368,7 @@ render_prompt(template_text, task) -> str
|
||||
```python
|
||||
# app/image_studio.py
|
||||
ImageStudioProject / ImageStudioAsset / ImageStudioJob / ImageStudioSelection
|
||||
ImageStudioHistoryAccount
|
||||
ImageStudioGenerationRound / ImageStudioHistoryRound
|
||||
create_or_get_project(account_or_fields, item_id, ...) -> ImageStudioProject
|
||||
list_projects(path=None) -> list[ImageStudioProject]
|
||||
@@ -383,7 +384,8 @@ list_jobs(project_id, statuses=None, path=None) -> list[ImageStudioJob]
|
||||
list_resumable_jobs(project_id=None, include_failed_downloads=False, path=None) -> list[ImageStudioJob]
|
||||
list_generation_rounds(project_id, limit=None, offset=0, path=None) -> list[ImageStudioGenerationRound]
|
||||
get_successful_generation_history_summary(project_id, path=None) -> ImageStudioSuccessfulGenerationHistorySummary
|
||||
list_global_generation_rounds(account_query="", item_query="", project_id=None,
|
||||
list_global_history_accounts(path=None) -> list[ImageStudioHistoryAccount]
|
||||
list_global_generation_rounds(account_alias=None, account_query="", item_query="", project_id=None,
|
||||
limit=None, offset=0, path=None) -> list[ImageStudioHistoryRound]
|
||||
list_generation_round_current_jobs(project_id, generation_round_key, path=None) -> list[ImageStudioJob]
|
||||
list_generation_round_attempts(project_id, generation_round_key, path=None) -> list[ImageStudioJob]
|
||||
@@ -424,6 +426,7 @@ export_generation_round(project_id, generation_round_key, parent_dir, path=None,
|
||||
- T-643 后 `image_studio_projects.current_generation_round_key` 记录项目主界面的当前生成轮次;`image_studio_jobs.generation_round_key` 与 `generation_slot_index` 记录整轮归属和稳定展示槽位。`promote_generation_round_if_success()` 只会在同项目、同轮已存在成功 job 时原子切换当前轮;`list_generation_rounds()` 返回轮次摘要,`list_generation_round_current_jobs()` 返回每个槽位最新尝试,`list_generation_round_attempts()` 返回完整尝试历史。旧 job 保持 NULL 并按“旧版历史记录”兼容,不猜测轮次边界。
|
||||
- T-646 后 `list_global_generation_rounds()` 是⑥跨项目历史的唯一查询入口:仅返回未软删除项目的轮次摘要,按创建时间倒序并支持账号/店铺、商品 ID、项目 ID、`limit`/`offset` 筛选;正常轮次只统计每个稳定槽位的最新有效 job,完整尝试数仅用于计算重试数,NULL 轮次保留“旧版历史记录”语义。`ProductSuiteGlobalHistoryDialog` 组合该查询和 `list_generation_round_current_jobs()`,默认读取30轮,显示受限缩略图并可按轮预览;窗口不写业务数据,也不改变当前轮次。`ProductSuiteHistoryExportWorker` 在后台调用 `export_generation_round()`,只复制该轮成功且存在的输出 asset 到用户选择目录中新建的安全子目录;同名目录追加稳定序号,不覆盖外部文件,部分文件失败只汇总中文结果,源 asset 保持不变。
|
||||
- T-648 后 `get_successful_generation_history_summary()` 是⑥常规新一轮生成前的只读判据:它只查询未软删除当前项目的最新有效成功 job,返回成功轮数、成功图片数和最近成功时间;正常轮次按稳定槽位取最新尝试,NULL 旧版轮次整体按一轮计数,只有失败/取消/进行中的 job 返回零摘要。该 API 不扫描文件目录、不创建 job/asset/轮次,也不改变当前轮;GUI 的“查看历史”仅调用全局历史窗口并临时启用当前商品筛选。
|
||||
- T-649 后 `list_global_history_accounts()` 只返回含 job 且未软删除项目的历史账号别名,供历史窗口补齐已删除账号的可选项。`list_global_generation_rounds(account_alias=...)` 以 `projects.account_alias = ?` 精确筛选;传入该参数时优先于旧兼容参数 `account_query`,后者仅保留给既有调用的模糊查询。当前账号显示文本来自账号管理,历史缺失账号只显示明确的历史标识,UI 不通过显示文本反查筛选值。
|
||||
- 拉取蝦皮原主图只读:复用 `editor.open_product(..., bring_to_front=False)` 和 `editor.read_product_image_urls()`,不上传、不拖拽、不点击更新。
|
||||
- 原图下载走 `image_studio_images` 的公网 URL、大小、Content-Type、重定向和 PIL 解码校验;只在用户单击时落盘。
|
||||
- `remove_original_assets_if_unused()` 会先校验整批原图的项目归属、资产类型及 job/终选引用,再在单个事务中删除资产行并连续重排 `source_order`;任一图片不可删除时整批不变,本地源文件和蝦皮线上图片始终保留。
|
||||
|
||||
Reference in New Issue
Block a user