feat(43): Actress Favorite + /search Integration#24
Merged
Conversation
新增 DB schema(CREATE TABLE IF NOT EXISTS actresses)、 Actress dataclass(to_dict/from_row JSON 序列化)、 ActressRepository 五個方法(save/get_by_name/delete_by_name/get_all/exists)。 save() 使用 ON CONFLICT(name) DO UPDATE SET 保留 created_at(CD-12)。 含 13 個 unit tests。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
新建 actress_photo 模組,提供 download_actress_photo(含 Referer 設定、 Content-Type 副檔名推斷、glob 刪舊檔)、get_local_photo_path、 delete_local_photo 三個公開函數。含 6 個 unit tests。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 新建 web/routers/actress.py:POST favorite / GET photo/{name} /
GET {name} / DELETE {name} 四端點
- Orchestrator 新增 ProfileResult namedtuple + get_cached_profile()
公開 cache 讀取,get_actress_profile 改回傳 ProfileResult(區分
timeout vs not-found)
- web/app.py 掛載 actress router
- 既有 orchestrator + actress_profile 測試同步更新(73 tests pass)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
search.py 新增 _fetch_actress_profile_with_db() — 已收藏女優從 DB 直接讀取(0 網路請求)+ is_favorite=True,未收藏走 orchestrator + is_favorite=False。REST 和 SSE 兩條路徑都套用。 修正 T3 ProfileResult 改造後 search.py 的相容性問題。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Footer:左 name 右 age,hover 顯示 height · cup · 三圍 - 愛心 overlay:.av-card-preview-overlay + .btn-glass-circle(CD-13) - 未收藏:hover 空心可點擊加入;已收藏:常駐實心純指示(CD-10) - addFavoriteActress():POST + 10s timeout + toast - 搜尋重置時清空 _actressFavoriteLoading 防競態 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
新增 actress lightbox metadata:名稱+愛心 / age·birth·三圍 / aliases chips / info chips / URL 連結。chips 超過 N 個顯示 +剩餘數 badge 可展開。lightbox 開關時重置展開狀態。 Lightbox 照片 img src 加本地路徑判斷(同 hero card)。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 四語系新增 search.unit.age/cup + search.actress.* 共 7 keys - capabilities.py 新增 favorite_actress / get_actress / unfavorite_actress 三個工具(含 side_effect + confirmation_required) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
新建 test_api_actress.py 含 12 個 TestClient 測試:
POST favorite(cache hit/miss/409/404/504/422)、GET {name}(200/404)、
DELETE {name}(200/404)、GET photo/{name}(200/404)。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- #ff4d6d 改用 --color-favorite CSS 變數(theme.css 定義) - hero card guard test 搜尋範圍 800→1200 字元(T5 overlay 增加了偏移量) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s 保序
P1: addFavoriteActress() 加 capturedProfile/capturedName capture +
await 後 stale-check(同 41d race pattern)
P1: 新增 _safeUrl() http(s) 白名單 guard,blog_url/official_url
不再直接綁 :href(防 javascript: scheme XSS)
P2: web/app.py 加全域 RequestValidationError handler 回固定中文 422
P2: actress.py makers 番號前綴→片商名轉換(load_prefix_mapping)
使用保序去重維持 gfriends probe 優先順序
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
minnano scraper 回傳 aliases 為 [{"ja":"...", ...}] 物件陣列,
前端 x-text 渲染為 [object Object]。新增 _flatten_aliases() helper
在 actress.py 和 search.py 兩處 flatten 為純字串 list。含 6 unit tests。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
新增 _actressSourceUrl() helper 構造文字來源頁面 URL (minnano 搜尋頁 / Wikipedia JP)。hero card footer 和 actress lightbox Row 1 各加一個 bi-box-arrow-up-right icon,點擊用 openSourceUrl() 開啟。is_favorite 或無文字來源時不顯示。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- search.py DB-miss 路徑:aliases flatten 後寫到 profile 頂層 (前端讀 actressProfile.aliases,不是 text.aliases) - 同時補齊 tags/agency/nickname 等 Phase 43 欄位到頂層 - source link icon 從 hero footer + lightbox Row 1 移到 cover-actions(取代返回詳情,與影片版一致) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f542fe56e0
ℹ️ 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".
P2-1: download_actress_photo 改用 actress.name(DB 正規化名)
而非 request raw name,修正 alias 搜尋時照片檔名不匹配
P2-2: addFavoriteActress finally 加 generation counter stale-check,
防止舊 request 的 finally 清掉新 request 的 loading flag
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
actresses表 + ActressRepository CRUD + 照片下載模組is_favorite旗標Test plan
🤖 Generated with Claude Code