Commit Graph
23 Commits
Author SHA1 Message Date
nvrl aec39e3961 fix(core,android): list a copied episode once, and keep recovered mpv errors off the player
A file copied into a second folder became a second episode: Inuyasha listed
episodes 1 and 2 twice. Library::build now keeps one of each file a title holds
more than once (same name, same size), preferring the copy played last and
otherwise the one in the folder holding more of the title, where an
ordered-chapters episode finds its opening and ending.

Android showed the first error-level line mpv logged as soon as it arrived,
so a High 10 episode that falls back to software decoding put "Could not open
codec." over a playing picture, and a copy without its opening and ending put
the missing timeline there. The error is now held until the file actually
ends with an error, as on iOS, and mpv's warnings and errors go to logcat
under pstr-mpv.
2026-11-25 04:04:59 +01:00
nvrl 18e2b78b2a Merge branch 'main' into feat/ordered-chapters 2026-11-24 23:56:18 +01:00
nvrl 76c2c70be1 feat(core,stream,app,cli,android,ios): play ordered-chapters openings and endings from beside the episode
An ordered-chapters episode links its opening and ending from other files
by SegmentUID. mpv looks for those in the episode's directory, which a
stream does not have, so the chapters were skipped.

Before an episode loads, read which segments it links to, read the
SegmentUID of the unnumbered files in the same folder, and hand mpv the
matching streams as an inline ordered-chapters-files playlist. A
candidate's SegmentUID is remembered by revision for the life of the
process.

On mobile, mpv re-opens the main URL while resolving references and
closes it again; native streams are now reference-counted per open so
that close no longer releases the stream that is playing.

Openings and endings on their own are no longer listed as episodes of a
numbered series.
2026-11-24 23:47:32 +01:00
nvrl 4240fe2f62 fix(android,ios): no playback error for a missing ordered-chapter part
A Matroska release that links its opening and ending from separate files
makes mpv log "Failed to find ordered chapter part!" and play the episode
without them. Android showed that line over the playing picture, and on
iOS it could stand in for the real reason a file failed. Both now skip it.
B71 in docs/BUGS.md.
2026-11-24 22:20:12 +01:00
nvrl 8be893258f fix(ios): play 10-bit and HDR files instead of failing to draw
Direct VideoToolbox hands mpv's Vulkan renderer surfaces MoltenVK cannot
import for some pixel formats, and the first error line mpv logged was
shown as fatal even when playback recovered. Decode with
videotoolbox-copy, and surface an mpv error only when the file actually
ends with one (B70).
2026-11-24 19:05:31 +01:00
nvrl 06874c51f4 Merge branch 'main' into fix/app-mpv-teardown 2026-11-23 13:38:58 +01:00
nvrl b8f8ebd5c2 fix(app,player): destroy the mpv core off the ui thread
The window froze for up to a second when an episode ended or the next
one started ("ui thread blocked for 1092 ms drawing the player page").
The UI thread's VideoSurface held the last handle to mpv, so dropping a
stopped Playback freed the render context and then ran mpv_destroy in
the frame, waiting for the demuxer and audio output to wind down. After
an end of file the player thread had not even sent `quit` (B69).

- The player thread sends `quit` on every way out.
- VideoRenderer frees the render context on the GL thread as before,
  then hands the core to an `mpv-teardown` thread. on_exit holds a
  handle across the drop so the core still dies before the process.
- app::timed names the remaining blocking parts at 100 ms: dropping
  the stopped player, rendering the video and mini picture, and
  rebuilding the library view.
2026-11-23 13:28:08 +01:00
nvrl d7b7efc8f0 fix(player): start on a libmpv built without Lua
The Flatpak builds libmpv with -Dlua=disabled, and mpv only declares its
`osc` option when Lua is built in. Player::new set it for the embedded
player and the window fallback alike, so both failed with
MPV_ERROR_PROPERTY_NOT_FOUND and every episode ended in the toast
"start mpv: mpv: Raw(-8)" (B68).

A missing `osc` now counts as already off; every other option still
fails as before. mpv errors are shown by mpv's own name instead of
libmpv2's Debug output.
2026-11-23 13:28:08 +01:00
nvrl 0d31654bf0 fix(core): keep a refresh after sign-out from storing the session again
Refresh tokens are single-use, so every refresh is written back. The callback
outlived a sign-out: the crawl and sync tasks keep the session alive, and
offline it cannot be ended, so a later refresh stored it again and the next
launch came back signed in. A second sign-in raced the same way.

Each sign-in and sign-out now starts a generation, and a refresh writes only
while its generation is current, checked under the lock the delete holds.
Sign-out deletes before ending the session. B67.
2026-11-22 17:15:11 +01:00
nvrl 6ccc0c5e69 fix(app): run on the discrete GPU and buffer 4K on Windows
4K HEVC 10-bit stuttered on a Windows laptop with an RTX 3050 (B66).

- proton-stream.exe exports NvOptimusEnablement and
  AmdPowerXpressRequestHighPerformance, through a .def file build.rs
  hands the linker, so hybrid-graphics drivers start it on the discrete
  GPU instead of the iGPU that owned the GL context mpv renders into.
- The desktop mpv buffer ceiling is 256 MiB instead of 48 MiB, about
  five seconds of a 4K remux. Safe above the block ring because the app
  runs block read-ahead at 0 (B8). Android keeps 48 MiB.
2026-11-22 16:36:49 +01:00
nvrl 3fe4900337 fix(android,ios): the track tick moves when a track is chosen, and no file inherits another's languages
Choosing an audio or subtitle track read the track list back before mpv
had made the switch, so the tick stayed on the old track until the next
poll. The tick now moves on the choice, and the list is read again
300 ms later to confirm it.

On Android, `load` set `alang` and `slang` only when they were not
empty. mpv keeps both across `loadfile`, so a file with no language
preference took the previous file's. Both are now set on every load.
This closes the last open item of B41.
2026-10-31 03:26:39 +01:00
nvrl cbe0f7166b fix(app): never let the system's CJK font stop the app at start
fc-match reports a variable font's named instance in the high 16 bits of
%{index}. Fedora's variable Noto Sans CJK answered 262144, egui read that
as a face index, and panicked on the font it could not parse. Keep only
the face, and parse the fallback with skrifa first so a font egui cannot
read is left out instead.

Fixes #1
2026-10-13 21:47:45 +02:00
nvrl aa0f4b1250 docs(android): mark B41's settings read as landed 2026-10-13 16:51:23 +02:00
nvrl 33da1563ee docs(android): stop describing Picture-in-Picture, and say what PLAN.md has not done
Picture-in-Picture was removed from the Android client, but B40 still
read as a live fix, B42 stayed open on a `pending` PiP case that no
longer exists, and two code comments still named it. PLAN.md marked
every recommendation done; its status now lists the ones a source
review found short.
2026-10-12 22:39:51 +02:00
nvrl 0b2813cd42 feat(core,stream,meta,app,android,cli): sign in to Proton and sync watch history
A Proton account is now optional alongside public links. Signing in (password,
then a second-factor code and a mailbox password where the account has them;
a CAPTCHA gate is solved in the Android app) stores one session blob in the OS
credential store under `proton-account`, writing back every refreshed token
since refresh tokens are single-use. With an account, folders of the viewer's
own Drive — My Files, other devices, shared with me — can be added as shares
through the same `ShareClient` surface as a public link.

Watch history syncs through a `proton-stream` device in that Drive: one
`watch-history/<installation>.json` per installation, so no two devices ever
write the same file. Each sync reads the others and merges per episode, newer
`updated_at` wins, with a deterministic tie-break. It runs at launch, after
sign-in, whenever the player closes and every five minutes. A session that can
no longer refresh signs the app out instead of failing on every launch.

The CLI gains `login`, `logout`, `account`, `browse` and `sync`.

Also in this change:
- Android offline downloads no longer look stuck (B64): two transfer at once,
  through a copy stream with no read-ahead, with a smoothed transfer rate.
- Choosing a metadata match by hand now enriches the title too, instead of
  keeping the old match's episodes and artwork.

The catalog schema is unchanged.
2026-10-06 13:06:54 +02:00
nvrl 6239780978 fix(app,packaging): keep libmpv and the taskbar icon across Windows upgrades
An MSI upgrade left the app without libmpv-2.dll until it was installed a
second time (B62). Costing runs before RemoveExistingProducts, saw the old
DLL at the same version and skipped the copy, and removing the old product
then deleted it. Both installer definitions now set REINSTALLMODE=amus;
every file is private to the install directory.

A taskbar pin lost its icon after a while (B63). The exe carried no icon
resource, and the Start Menu shortcut's icon lived in the per-ProductCode
installer cache that each upgrade deletes. build.rs now compiles the .ico
into proton-stream.exe, and the shortcut has no Icon of its own (and in the
WiX build is no longer advertised), so both show the exe's icon.
2026-10-06 03:04:07 +02:00
nvrl 4c80076762 fix(core,meta,app,android,cli): number episodes the way releases do
AniList's per-season lookup searched for "<title> 2nd Season" and the
scorer picked the base entry again, so Attack on Titan seasons 2-4 and
Jigokuraku season 2 were captioned with season one's names. Episode
names came from streamingEpisodes, which is partial and numbered however
a streaming site counted. Bleach S17 and Mushishi S02/S03 had none.

AniList now walks SEQUEL relations from the match and takes each
entry's episodes from ani.zip, which carries TVDB's season, number and
absolute number. An episode row keeps all three plus its place in the
AniList entry. EpisodeGuide::get matches whichever numbering a file
uses and never answers from another season.

Episodes and fanart are stored as one enrichment. The episode list is
replaced even when empty, and the enrichment is recorded as asked, so a
film is not re-asked every run. Storing a different match drops the old
entry's episode rows. AniList's 4.75:1 bannerImage is no longer stored
as the 16:9 backdrop; ani.zip's 1920x1080 fanart is used instead.

Schema v9 adds the columns and deletes the AniList episode rows and
banners. Matches are kept. Desktop, Android and the CLI now share
service::plan and MetadataService::work. The settings text names
ani.zip. Audit and roadmap in docs/METADATA.md; bug entry B61.
2026-10-04 00:47:41 +02:00
nvrl 4027ab5fb3 feat(app): polish pass - toasts, shortcuts, redesigned pages, cheaper frames
- toasts replace the status line; keyboard shortcuts with a ? overlay
- library: filters, sort, row virtualisation, cached search, skeleton
  tiles until the catalog loads, gradient placeholder art
- title page: season pills, episode rows with stills and one download
  glyph, portrait poster, clamped overview, resume time in the button
- player: fading chrome, smooth scrims, subtitles lifted over the
  controls, drag-following seek knob, OSD, speed menu, auto-skip
- settings as grouped cards with toggles and palette previews
- shares: confirm before removing, inline link validation, form kept
  until the add succeeds; downloads scroll and show rate and ETA
- downloads pipeline four blocks; the next episode is warmed near the end
- a film behind another page repaints at 4 Hz, not its frame rate

Fixes B55-B60.
2026-10-02 19:27:28 +02:00
nvrl ad24557588 feature(gui) themes + chore(deps) version bump 2026-08-15 14:49:04 +02:00
nvrl dc85890a9f docs: android review ledger, design tokens, test notes
B14-B42 record the Android review the theme and lifecycle work came out of.
DESIGN-TOKENS.md states what both clients agree on and where each keeps its
copy.
2026-08-10 01:10:13 +02:00
nvrl 46bb68e3a5 improved android ui 2026-08-09 19:12:41 +02:00
nvrl f1b3ad9637 improved android client, feature parity with desktop 2026-08-09 16:40:37 +02:00
nvrl a1b345a029 init 2026-08-02 19:37:03 +02:00