Open on the Feed, and refresh it without hammering yt-dlp

The tab order was Watch, Search, Feed, Browse, Downloads, and the app opened
on Watch -- which is where the other tabs send you, not somewhere you start.
It is now Feed, Search, Browse, Downloads, Watch, with icons. Routing is
unaffected: _tab_index_of resolves by widget identity, not position.

Refresh-on-open needed care rather than a call in showEvent. A local refresh
is one yt-dlp subprocess per subscribed channel, serially, so it is braked
four ways: only channels not seen for feed.auto_refresh_on_open_minutes (30,
0 to disable), at most eight per visit, once per interval per session, and
after a delay so it does not race the tab transition or first-run setup. The
cached feed is already on screen throughout. That is a new config key rather
than the dead auto_refresh_minutes, because existing configs store that as 0
and would have read as opting out of a feature that did not exist yet.

SmoothTabWidget gained the currentChanged signal, icons and a corner slot it
never had. Its set_current_index needed a re-entrancy flag, not just an index
check: setting the tab bar's index emits its currentChanged straight back into
the same method, and at that point the stack has not moved, so every switch
fired the activation hook twice.

The grid was cleared and rebuilt after every channel finished -- flicker, lost
scroll position and every thumbnail re-read from disk each time. merge_entries
keeps existing cards. While there, _relayout was re-adding cards the layout
already owned, so layout items accumulated on every Load more, and the resize
check compared against columnCount(), which never shrinks, so it relaid out on
every resize event.

Smaller things this exposed: feed errors were written into the label the next
success overwrote, so failures were invisible; switching to account mode left
the local videos on screen; cancel() had no callers, so a refresh outlived the
tab and the window; Browse's Subscribe never said Unsubscribe though it
toggles; "Play all" queued one page while claiming otherwise; and the feed
sorted publish times against wall-clock fetch times in one COALESCE, so the
last-refreshed channel floated to the top.

Feed is the first thing seen now, so an empty one says what to do about it
instead of showing a bare grid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-09 01:11:40 +02:00
parent 27933dd495
commit 79a6f26c2f
9 changed files with 453 additions and 80 deletions
+56 -34
View File
@@ -39,6 +39,40 @@ records.
application had a tooltip. An application-level polish filter now fills them
in as each button is first shown, and swaps placeholder emoji for icons —
which covers dialogs owned by upstream without editing them.
- **Skip this version** in the update dialog. The skipped version is never
offered again; later ones still are.
### Changed
- **The tab order is Feed → Search → Browse → Downloads → Watch**, each with an
icon, and the app opens on the Feed. Watch was first, which is where the
other tabs send you rather than somewhere you start.
- **Opening the Feed refreshes it**, but only channels not seen for 30 minutes
(`feed.auto_refresh_on_open_minutes`, 0 to switch off), at most eight per
visit, once per interval per session, and after a short delay. A refresh is
one yt-dlp subprocess per subscribed channel, so an unthrottled one would be
a lot of them. The cached feed still appears instantly; manual Refresh always
does everything.
- mpv is given an explicit `hwdec` list per platform (`player.hwdec`, default
`auto`), each ending in software decoding, so a machine with broken GPU
interop plays rather than showing a black frame. This does **not** silence
`Cannot load libcuda.so.1` — that comes from the driver stack below mpv and
appears with `hwdec=no` too.
- **The update check now looks at SageTube's own releases.** It queried PyPI's
`ytsage` package for the version and `oop7/YTSage` for the changelog, then
linked to upstream's downloads — a different program's release stream. It now
reads `git.houmeres.sk/Houmeres/SageTube` releases, anonymously, and the
"Download update" button opens this repository's release page.
- The beta channel follows SageTube pre-releases. Upstream's inherited `b` tags
(`v5.3.0b` and earlier) read as pre-releases, so a stable instance cannot be
offered one.
- The check now runs at most once a day rather than on every start.
- The About dialog and the update settings say SageTube rather than YTSage. The
"Based on YTSage by oop7" attribution link stays — it is the MIT credit.
- Configs now carry `config_version`. A file written before 5.4.0 — including one
inherited from an upstream YTSage install — has its stored `check_app_updates`
cleared once, so SageTube's own default applies rather than a setting that
pointed at another project's releases.
### Fixed
@@ -57,6 +91,28 @@ records.
- The window icon shipped only at 48px and was upscaled everywhere; the 256px
master now ships beside it. Its fallback was the platform's download arrow
standing in for the application's identity.
- **The feed grid no longer flickers or loses your scroll position.** It was
cleared and rebuilt from scratch after every channel finished, re-reading
every thumbnail from disk each time; finished channels are now merged in and
existing cards left alone. The docstring's claim that it "fills
incrementally" is finally true.
- Card layout items accumulated: each `Load more` re-added cards the layout
already held, and the resize check compared against `columnCount()`, which
never shrinks — so it relaid out on every single resize event.
- Feed failures were invisible. The error was written into the same label the
next successful channel immediately overwrote; the count is now reported once
when the refresh ends.
- Switching the feed to account mode left the local videos on screen, so one
mode's contents appeared to be the other's.
- Leaving the Feed tab or closing the window cancels a running refresh.
`cancel()` existed and had no callers, so a sweep kept running and the window
could be closed while its thread was live.
- Browse's Subscribe button never said "Unsubscribe", although pressing it
toggles; its only feedback was a status line on a different tab.
- "Play all" quietly queued just the loaded page and claimed to be everything.
- The feed sorted by publish time and fetch time in the same expression, so the
most recently refreshed channel floated to the top regardless of how old its
videos were.
- **The player no longer crashes the app.** Qt destroys and recreates a
widget's OpenGL context whenever it moves to another top-level window, and
calls `initializeGL()` again. libmpv allows one render context per handle, so
@@ -83,33 +139,6 @@ records.
reason — every dialog in the app screenshotted the whole window.
- The saved volume never reached mpv: the slider set its restored value before
its change signal was connected, so playback always started at 100.
### Changed
- mpv is given an explicit `hwdec` list per platform (`player.hwdec`, default
`auto`), each ending in software decoding, so a machine with broken GPU
interop plays rather than showing a black frame. This does **not** silence
`Cannot load libcuda.so.1` — that comes from the driver stack below mpv and
appears with `hwdec=no` too.
- **The update check now looks at SageTube's own releases.** It queried PyPI's
`ytsage` package for the version and `oop7/YTSage` for the changelog, then
linked to upstream's downloads — a different program's release stream. It now
reads `git.houmeres.sk/Houmeres/SageTube` releases, anonymously, and the
"Download update" button opens this repository's release page.
- The beta channel follows SageTube pre-releases. Upstream's inherited `b` tags
(`v5.3.0b` and earlier) read as pre-releases, so a stable instance cannot be
offered one.
- The check now runs at most once a day rather than on every start.
- The About dialog and the update settings say SageTube rather than YTSage. The
"Based on YTSage by oop7" attribution link stays — it is the MIT credit.
### Added
- **Skip this version** in the update dialog. The skipped version is never
offered again; later ones still are.
### Fixed
- **The app no longer offers upstream YTSage's releases as its own updates.**
`__version__` and `pyproject.toml` had been left at the scaffolded `0.1.0`
while the released tag was `v5.4.0`, so every comparison against upstream's
@@ -124,13 +153,6 @@ records.
the settings tab read a missing `check_app_updates` as enabled and then
persisted that reading unconditionally.
### Changed
- Configs now carry `config_version`. A file written before 5.4.0 — including one
inherited from an upstream YTSage install — has its stored `check_app_updates`
cleared once, so SageTube's own default applies rather than a setting that
pointed at another project's releases.
## 5.4.0 — 2026-08-08
### Changed