fix: review round 2 — Clear watch progress clears only the resume point, big view focus by the way it arrived, dialog name, reason tooltip, backfill locks
This commit is contained in:
@@ -29,10 +29,10 @@ export interface Video {
|
||||
watch_url: string;
|
||||
}
|
||||
|
||||
/** Whether a video has anything its reset would clear: pristine = never opened, the default status
|
||||
* and no resume position. The card's reset button and the card menu's reset both ask this. */
|
||||
export function isResettable(v: Pick<Video, "status" | "position_seconds">): boolean {
|
||||
return v.status !== "new" || v.position_seconds > 0;
|
||||
/** Whether a video has a resume point, the one thing "Clear watch progress" clears. Its status is no
|
||||
* part of it: a hidden video stays hidden, a watched one watched. */
|
||||
export function hasResumePoint(v: Pick<Video, "position_seconds">): boolean {
|
||||
return v.position_seconds > 0;
|
||||
}
|
||||
|
||||
/** A video's related videos, in the locale YouTube fills the list in: on the video's topic, or with
|
||||
@@ -290,8 +290,8 @@ export const feedApi = {
|
||||
{ method: "POST", body: JSON.stringify({ status }) },
|
||||
{ idempotent: true },
|
||||
),
|
||||
clearState: (id: string) =>
|
||||
req(`/api/videos/${id}/state`, { method: "DELETE" }, { idempotent: true }),
|
||||
clearProgress: (id: string) =>
|
||||
req(`/api/videos/${id}/progress`, { method: "DELETE" }, { idempotent: true }),
|
||||
// Returns the position the server actually STORED — which is not always what we sent: a
|
||||
// trivially-early or near-finished checkpoint is cleared to 0 (see set_video_progress). Callers
|
||||
// that mirror the position into a cache must write this answer, never their own reading, so the
|
||||
|
||||
Reference in New Issue
Block a user