fix: 缩略图上传失败(upload_to_oss str/Path 类型不匹配) #602

Merged
auto-approve-bot merged 1 commits from fix/thumbnail-upload-str-path-bug into develop 2026-07-19 17:53:27 +08:00

1 Commits

Author SHA1 Message Date
CI Bot d2a8aa1173 fix: 缩略图上传失败(upload_to_oss str/Path 类型不匹配)
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 25s
AI Code Review / AI Code Review (pull_request) Failing after 41s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1m1s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Successful in 35s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 3m42s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 3m6s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 4m40s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m36s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Successful in 7m24s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 8s
thumbnail_generator.py 等调用方传 str 类型路径,upload_to_oss 函数签名
写的是 Path,导致 local_path.stat() 报 AttributeError,缩略图上传失败
返回 None,异常被吞掉不影响主流程但封面一直是默认图。

修复:函数入参兼容 Path | str,入口处统一转 Path 对象。
其他传 Path 的调用方无副作用。
2026-07-19 17:45:34 +08:00