Repository navigation
Conversation
- Add a Lsky Pro (v1 API) storage driver with token or email/password auth - Map albums to folders and images to files, with list, link, mkdir, remove and upload - Support overwrite uploads and unique display names for duplicate entries - Register the driver in drivers/all.go and add a unit test for name de-duplication Co-authored-by: Claude <81847+claude@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 745be84316
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else { | ||
| params["album_id"] = albumID | ||
| } | ||
| images, err := listAll[Image](ctx, d, "/images", params) |
There was a problem hiding this comment.
Restrict root image queries to unalbumed records
When the mounted root has ID 0, params contains only order; Lsky Pro API v1 interprets an omitted album_id as no album filter, so this call appends every album image at the root and then exposes it again inside its album. Deleting or overwriting the apparent root copy therefore mutates the same image in the album; this branch needs to send the API's explicit no-album/root filter.
Useful? React with 👍 / 👎.
| // Lsky Pro keeps same-named images side by side, so replace the old one | ||
| // when OpenList is overwriting an existing file. | ||
| if old := file.GetExist(); old != nil && old.GetID() != img.Key { | ||
| if err := d.Remove(ctx, old); err != nil { |
There was a problem hiding this comment.
Keep the overwritten duplicate at its original path
When the gallery already contains two a.png images, List's earliest ordering exposes the first as a.png and the second as a (<id>).png; overwriting /a.png uploads a third copy and this deletion removes only the formerly canonical first copy. After the next cache refresh, the second old image becomes a.png while the new upload receives the suffix, so reading the path just overwritten returns old content; duplicate display names need stable path assignment across replacement.
Useful? React with 👍 / 👎.
| name := o.GetName() | ||
| if _, dup := seen[name]; dup { | ||
| ext := path.Ext(name) | ||
| name = name[:len(name)-len(ext)] + " (" + o.GetID() + ")" + ext |
There was a problem hiding this comment.
Retry suffixes that collide with an existing name
If a real filename already equals a suffix synthesized later—for example objects ordered as a (bbb).png, a.png, and another a.png whose ID is bbb—this assignment generates a name that is already in seen but never checks it again. The resulting listing still has two identical OpenList paths, leaving one object unreachable and allowing operations to target the wrong record; suffix generation should continue until it finds an unused name.
Useful? React with 👍 / 👎.
Summary / 摘要
/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
Related repository PRs / 关联仓库 PR:
Related Issues / 关联 Issue
Testing / 测试
go test ./...Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Translation / 翻译
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。