Skip to content

分拣台:刷新勾选收藏夹的列表时重算取消收藏记录的「还在别处」 - #436

Merged
PathGao merged 1 commit into
mainfrom
fix/unfav-elsewhere-refresh
Oct 27, 2026
Merged

PathGao merged 1 commit into
mainfrom
fix/unfav-elsewhere-refresh

Conversation

@PathGao

@PathGao PathGao commented Oct 27, 2026

Copy link
Copy Markdown
Owner

改了什么

在分拣台把视频从唯一的勾选收藏夹 A 取消收藏,之后在 B站 直接把它收进勾选收藏夹 B,B站 普通页面仍标「已取消收藏」。反过来也一样:取消收藏时它还在 B,之后在 B站 从 B 移出,就一直不标。取消收藏记录里的 elsewhere 只在取消收藏那一刻算一次。

  • 分拣台每存下一个勾选收藏夹的完整列表(saveSnapshot),在同一把锁里按最新的缓存列表重算其他收藏夹取消收藏记录的 elsewhere,只写变了的(TriageCore.refreshElsewhere、refreshElsewhereNow)。
  • 没读全的列表本来就不存快照,也就不触发重算。某个收藏夹还没有完整列表时,不会把视频判成「不在别处」。稍后再看不算。
  • B站 页面仍只读决定。DESIGN.md 那一条同步。
  • 没覆盖:分拣台自己的「收藏到 / 移动」不触发重算,要等下次刷新那个收藏夹。

验证

  • node scripts/selftest.mjs:39 个通过。triage-core 加了表格测试(两个方向、自己的收藏夹不算、没变的不重写、没有完整列表的收藏夹不改成「不在别处」、保留记录不碰),另有走真实 saveSnapshot 的测试;去掉 saveSnapshot 里那行调用,测试失败。
  • 没测到:真 B站 收藏夹(要在登录态下改收藏)。

在 B站 把取消收藏过的视频收进或移出另一个勾选收藏夹后,B站 页面的「已取消收藏」跟着改;没读全的列表不算。
@PathGao
PathGao merged commit a619782 into main Oct 27, 2026
2 checks passed
@PathGao
PathGao deleted the fix/unfav-elsewhere-refresh branch October 27, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant