fix: a refresh no longer drags you off a channel; cap Download all

The auto-refresh could throw you back to All subscriptions and then
refuse to let you back in. useFeed rebuilt reload() whenever the filter
changed, so a refresh started before you picked a channel still held
the old closure: half a minute later it re-fetched the unfiltered list
and overwrote yours. The sidebar still showed the channel as selected,
so clicking it changed nothing and there was no way back except via
another channel.

reload() now reads the filter at call time instead of capturing it, and
carries a sequence number so a slow reply cannot overwrite a newer one.
It is stable across filter changes, which also stops the auto-refresh
interval being torn down and restarted every time you click a channel.

Download all now works from All subscriptions too, capped by a new
Settings limit (default 25, up to no limit). It takes the newest first
and says what it did — "Queued the newest 25 of 500" — so a cap is
never silent. Press it again for the next batch.
This commit is contained in:
vincent
2026-08-29 16:13:44 +02:00
parent caea8bad8f
commit 66cb80a044
5 changed files with 100 additions and 22 deletions
+24
View File
@@ -6,6 +6,7 @@ import {
import { APPEARANCE_MODES, type Appearance } from "../hooks/useAppearance";
import {
QUALITIES, STREAM_QUALITIES, SUB_LANGS,
BULK_LIMITS,
type ImportPreview, type Prereqs, type Quality, type UpdateStatus,
} from "../types";
import TakeoutGuide from "./TakeoutGuide";
@@ -21,6 +22,8 @@ interface Props {
onAppearance: (a: Appearance) => void;
quality: Quality;
onQuality: (q: Quality) => void;
bulkLimit: number;
onBulkLimit: (n: number) => void;
streamQuality: Quality;
onStreamQuality: (q: Quality) => void;
subLang: string;
@@ -53,6 +56,7 @@ function StatusRow({ label, value }: { label: string; value: string | null }) {
export default function Settings({
onClose, onImported, appearance, onAppearance, quality, onQuality,
bulkLimit, onBulkLimit,
streamQuality, onStreamQuality, subLang, onSubLang, hideShorts, onHideShorts,
browser, onBrowser, onError,
}: Props) {
@@ -218,6 +222,26 @@ export default function Settings({
</select>
</label>
<label className="mt-2 grid grid-cols-[92px_1fr] items-center gap-2">
<span className={LABEL}>Download all</span>
<select
value={bulkLimit}
onChange={(e) => onBulkLimit(Number(e.target.value))}
className={SELECT}
>
{BULK_LIMITS.map((b) => (
<option key={b.value} value={b.value}>
{b.label}
</option>
))}
</select>
</label>
<p className={`mt-2 ${HELP}`}>
The cap on one <b>Download all</b>. It takes the newest first, so from
All subscriptions you get the latest across every channel rather than
several hundred videos at once. Press it again for the next batch.
</p>
<label className="mt-2 grid grid-cols-[92px_1fr] items-center gap-2">
<span className={LABEL}>Streaming</span>
<select