Commit Graph
112 Commits
Author SHA1 Message Date
nvrl 82ec1e9c51 feat(cli): count a benchmark's Drive requests by route
`pstr bench --requests` gives the bench its own telemetry sink and
prints, per phase, the API calls by route, the block downloads and the
SDK operations they belong to. Only the share holding the file is
opened, so the share-open count is that share's alone.

Routes keep their shape with ids replaced by `{id}`, and nothing else
from an event is stored, so the report holds no URL, name or token.
The SDK reports one event per logical call, so retries inside a call
are not counted; the report says so.

Moves proton-sdk and proton-drive-rs to 0.12.9, which reports the
public-link handshake to telemetry with fixed endpoint labels.
2026-11-28 15:59:37 +01:00
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 c58892b565 Merge pull request #46 from narrrl/feat/season-art
feat(core,meta,app,android,ios): show each season's own poster, name and synopsis
2026-11-25 00:54:30 +01:00
nvrl 1d5fb8ada7 feat(core,meta,app,android,ios): show each season's own poster, name and synopsis
AniList files every season as an entry of its own, and a title matches the
first, so picking season three of The Apothecary Diaries still showed
season one's cover and synopsis.

Enrichment already walks the sequel chain to find the episodes; the
relations query now also asks each entry for its cover, banner, name,
synopsis and year. A library season takes the art of the entry that
answers its lowest-numbered file, and the result is stored as JSON in a
new season_art column (schema 16), kept across a refresh of the match the
same way the chain is.

Desktop shows the picked season's poster, name and synopsis in the title
header; Android (phone and TV) and iOS show its name, cover and synopsis
above the episodes. Seasons the match itself answers keep the title's art.
2026-11-25 00:50:46 +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 e043f1f474 Merge branch 'main' into perf/crawl 2026-11-24 23:09:31 +01:00
nvrl 2f91a91ed2 Merge pull request #40 from narrrl/feat/pstr-invites
feat: pstr:// invites to share a share or a whole library
2026-11-24 23:09:04 +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 de9ab54ec6 fix(app,android,ios): issues found walking the library on desktop, phone and TV
Desktop:
- a tile's subtitle under a two-line name was cut through its middle;
  the caption area is 60 px, not 54
- shelves no longer draw a scroll bar over their last captions
- each page keeps its own scroll position, so a title opens at its top
  and Back returns to the same place in the library
- a folded synopsis runs its paragraphs together instead of leaving the
  ellipsis alone on a line
- the Gradient accent setting describes what it does now

Android and iOS:
- over the banner's artwork, More info and My List are a translucent
  wash of the text colour, so Play is the one coloured button
- a tile's press ripple no longer cuts into the first letter of its
  caption
- a show watched through offers Play S01E01, not Continue with S01E01
- on TV, the title page's secondary buttons sit on a wash of the page
  and stay readable over bright artwork
2026-11-24 22:11:58 +01:00
nvrl f56f839340 docs(android): what to try when a TV box plays video in slow motion 2026-11-24 19:50:23 +01:00
nvrl 46a3df2f04 perf(core,app,android,cli): recrawl only what changed
A crawl of an account folder spent most of its time unlocking file node
keys, one S2K derivation of tens of milliseconds per file, only to read
each file's claimed size. Folders are now walked light (names, revisions,
no file keys), and only files the catalog does not already hold at their
current revision are opened in full (SharedLibrary::crawl_known,
Catalog::known_files). On a 1,353-node library a recrawl went from
20-27 s wall and 88 s CPU to 5 s wall and 9 s CPU. A first crawl costs
what it did; public links have no light listing and are unchanged.

- The catalog stores a crawl as a diff: unchanged rows cost a lookup
  instead of a delete, an insert and three index updates.
- Desktop: row building and SQLite run on blocking threads, off the
  workers the other shares' listings use; shares finishing together
  rebuild the library at most every 2 s, and once at the end.
- Android: shares crawl three at a time instead of one after another,
  the session is refreshed only when old, and the offline index is read
  once per crawl.
- pstr crawl --timings breaks each share's time into listing, parsing
  and storing.
2026-11-24 19:48:23 +01:00
nvrl 749c249ada feat(core,app,cli,android,ios): share a share or a whole library with a pstr:// invite
A share was two secrets in two messages and a trip through the Add form
per share. An invite (pstr-core::invite) carries any number of shares,
links and custom passwords together, as pstr://add?v=1&s=<base64url JSON>,
and is shown as a QR code too.

- Desktop: an invite button on each share row and "Share the whole
  library"; a dialog with the QR code and Copy link. An invite clicked,
  pasted anywhere or typed into the Add form opens a confirmation that
  lists what it adds, greying out shares already here.
- The desktop entry and the MSI register the pstr scheme; a second
  launch hands the invite to the open window.
- Android and iOS: Invite in a share's menu, Send / Copy / QR, and the
  same confirmation for a tapped or shared invite. The TV shows the QR.
- pstr invite / pstr accept in the CLI; accept asks for the invite
  rather than taking it as an argument.

The link is never printed: it is copied or sent on purpose, the clipboard
copy is marked sensitive (Android) and local-only (iOS), and every
surface says that an invite holds passwords. Account folders have no
link and are left out, with a note.
2026-11-24 19:28:01 +01:00
nvrl 0d53d1cf72 feat(core,app,android,ios): solid accents, a copper scale and one scrim curve
- The accent is a flat fill. With gradients on (now off by default) it
  shades into a darker tone of itself, never into orchid.
- Copper gets a 100-700 scale; as an accent on dark it uses the lit 400.
  iOS shows the copper rating star and new-episodes badge like Android.
- Every scrim over artwork follows one eased curve (SCRIM_STOPS), layered
  by job instead of one many-stop ramp. The desktop banner is taller and
  loses its full-picture wash.
- One solid focus ring on every client; the TV gradient border and the
  desktop's inner copper ring are gone.
- Missing art is a plain card with initials, not a hashed colour ramp.
- A portrait poster in a landscape card fills the frame with a dimmed
  crop of itself.
2026-11-24 19:05:31 +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 0304911d57 Merge pull request #35 from narrrl/feat/tv-watch-next
feat(android): Watch Next and voice search on a TV
2026-11-23 23:44:45 +01:00
nvrl 79e43ed842 feat(android): Watch Next and voice search on a TV
Roadmap C4. On a television:

- Continue watching also appears on the launcher's home screen, in its
  Play Next row (TvContract.WatchNextPrograms, WRITE_EPG_DATA), with the
  place and length, the provider's art and synopsis, and the episode's own
  name and numbers, never a file name. A card plays its episode through
  ACTION_PLAY_EPISODE. A card the viewer removed stays off until that
  episode is watched again. Settings → Playback has a switch, on by
  default and shown only on a TV.
- The Search page has a mic beside the field, and the remote's Search key
  opens Search listening from any page (RecognizerIntent).
- The assistant's "search for … on Proton Stream" (SEARCH, SEARCH_ACTION)
  opens Search with what was said; "play … on Proton Stream"
  (MEDIA_PLAY_FROM_SEARCH) plays the one title of that name from where
  the viewer is, else shows the search. A search from outside the field
  moves the focus to its results without leaving a keyboard over them.

Fast-forward and rewind through the media session were already in place
from C1.
2026-11-23 23:28:39 +01:00
nvrl 022c0acd7e fix(android): run Robolectric offline against a Gradle download
Android CI on main failed after v2.3.0 merged: DownloadStateStoreTest,
ScreenshotTest and TvTest all died in MavenArtifactFetcher with an
IOException. Robolectric downloads its Android runtime from Maven Central
by itself while the tests run, outside Gradle, so one dropped connection
fails every Robolectric test. The actions/cache meant to keep that jar never
held anything: a run that fails on the download saves no cache.

Gradle now downloads android-all-instrumented for API 34 like any other
dependency, with its retries and the Gradle cache CI already restores, and
the tests run with robolectric.offline against that copy. The cache step
goes.
2026-11-23 22:59:12 +01:00
nvrl 4409210853 Merge pull request #33 from narrrl/release/2.3.0
chore(release): 2.3.0
2026-11-23 22:14:14 +01:00
nvrl 51c74f1425 Merge pull request #31 from narrrl/feat/suite-look
feat: the suite's look, and a Stream mark with currents
2026-11-23 21:42:12 +01:00
nvrl 585439fbfd feat(core,android): add a share to a TV from a phone
Typing a share link on a remote is the worst part of setting up a TV.
Add share on a TV now shows a QR code instead. The phone's camera opens
a page the TV serves on the home network, the link is pasted there, and
the TV opens it through the same path as the typed form. A refusal (a
wrong password, an incomplete link) goes back to the page with the link
kept, so it is fixed where the keyboard is. The phone needs nothing
installed.

pstr-core::handoff listens on the TV's private IPv4 address only, under
a random 60-bit path, for ten minutes or until a share is added. The page
runs no script and its CSP allows none; requests are size- and
time-bounded. It is plain HTTP, which PRIVACY.md states, and "Type it
instead" keeps the ordinary form.
2026-11-23 20:27:28 +01:00
nvrl 6ae611a5a4 feat(app): a floating bar, the mark and a visible focus ring
The desktop takes the suite's look: the nav floats as a rounded bar with
the Stream mark, buttons and tabs are pills, cards round to 12, and
new-episodes badges and the rating star wear the palette's copper.
About shows the mark, the version and the suite.

Keyboard focus was nearly invisible on the dark pages. Every focusable
widget now draws a 2px accent ring with a copper inner edge, and a
focused segmented chip no longer shifts its row. Palette cards ellipsise
long names instead of overlapping.

DESIGN-TOKENS gains the suite's shared tokens, shapes and focus, and the
desktop screenshots are retaken.
2026-11-23 19:15:47 +01:00
nvrl b9e48177a0 feat(core,android,ios): the suite's palette, Proton Light and Copper
Proton now wears the plum neutrals and violet of Proton Drive and Proton
Gallery, and its Mauve gradient runs into the icon's orchid. Proton Light
is the suite's light page, and Copper joins the accents. Every palette
carries a highlight, copper on the Proton flavours, which new-episodes
badges, the rating star and the TV focus ring wear.

Android takes the suite's radii (12 cards, 16 sheets, 24 floating, pill
buttons), shows the mark in the Library bar, About and empty states,
and the TV type ramp moves to Inter at tv-material's sizes. Title actions
shrink to fit rather than ellipsise at large font sizes, now pinned by a
360dp, 2x font capture. iOS mirrors the palette, radii and choices.
2026-11-23 19:14:22 +01:00
nvrl 3ca6d58fb8 Merge pull request #30 from narrrl/feat/android-tv-ui
Feat/android tv UI
2026-11-23 17:18:16 +01:00
nvrl 316e7b7c4a docs: Android TV screenshots 2026-11-23 16:32:32 +01:00
nvrl 12187ba1d5 fix(android): make the TV pages work with a remote
Ran the TV UI on an Android TV emulator with a real library and fixed
what came up:

- The app started with the focus in the menu, not on the page.
- Left from a card landed on the menu entry level with it, not on the
  page that is open.
- Down on the search field stayed in the field, so the results could
  not be reached.
- Compose's TV scrolling stops a third of the way in, which cut the row
  above in half on Home and scrolled a title's name away under Play.
  Rows on Home now line up under the top, and a title page, search and
  a genre page scroll only as far as needed.
- Home showed My List twice: as its own row and as the core's shelf.
- A focused episode's text was dark on a dark surface.
2026-11-23 16:32:32 +01:00
nvrl f2261acd0e feat(android): give the TV a UI of its own
On a television MainActivity now composes ui/tv/TvApp instead of the
phone's ProtonStreamApp: the same AppViewModel, library, account and
player, laid out for a screen across a room on androidx.tv:tv-material.

- A navigation drawer down the left edge: Home, Search, History,
  Downloads, Shares, Settings.
- Home: the focused title's backdrop, name and synopsis at the top,
  following the focus after a short pause, and rows of Continue
  watching, My List, the shelves and every title under it.
- A title's page opens with Play focused, then Start over, My List and
  Mark watched, season chips, episodes with stills and synopses, the
  franchise and More like this.
- Search and Browse pages; OK on the field opens the TV's keyboard or
  voice input.
- Menu, or holding OK, opens a focusable menu where a phone has a long
  press. Rows remember the card they were left on.
- The player covers everything and nothing is composed under it.
  Leaving the video stops it: a TV has no mini player.
- History, Downloads, Shares and Settings are the phone's pages inside
  the overscan margins for now.
2026-11-23 14:14:39 +01:00
nvrl 31c63d2eb0 Merge pull request #28 from narrrl/feat/android-tv-foundation
feat(android): drive the app with a TV remote
2026-11-23 13:51:53 +01:00
nvrl 06874c51f4 Merge branch 'main' into fix/app-mpv-teardown 2026-11-23 13:38:58 +01:00
nvrl b40b0c522d Merge pull request #26 from narrrl/fix/player-no-lua-osc
fix(player): start on a libmpv built without Lua
2026-11-23 13:38:22 +01:00
nvrl 6383f26693 feat(android): drive the app with a TV remote
Issue #5: on an Android TV the app installed but needed a touch screen.
This is the groundwork both the phone UI and a later dedicated TV UI
need.

- The focused control is outlined in the accent, and artwork grows a
  little, instead of Material's ten percent tint.
- The Menu key opens what a long press opens: the Continue watching
  and tile menus, and "Mark watched up to here" on an episode.
- Closing a title gives the focus back to the tile it was opened from.
  The featured banner stops turning while one of its buttons is
  focused.
- Player: a key press keeps the controls up, and Play takes the focus
  when they appear. Skip, Up next, the end card and Retry take the
  focus when they show, and Back hides the controls first. Rewind and
  fast-forward seek 10 s, also from the media session. Next, previous
  and stop work too. A TV has no rotation lock or touch lock.
- On a TV: navigation rail, single pane, overscan margins, a shorter
  banner, and a CAPTCHA window that fits a 540 dp screen.
2026-11-23 13:37:54 +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 a102ccd880 docs: the Android APK also runs on 32-bit ARM 2026-11-23 02:23:57 +01:00
nvrl 7e958ae7d8 feat(packaging): AUR packages proton-stream, -bin and -git, published on release 2026-11-22 23:28:02 +01:00
nvrl c896693ff8 feat(core,app,android,ios): crawl own-Drive folders when Drive reports a change
The crawl and ShareClient now come from proton-drive-tree-rs: DriveTree is
the old ShareClient, and walk is the old parallel, retrying crawl plus a
cycle check. A crawl of an account folder also records where Drive's change
feed stood and which nodes it found.

The desktop app polls the feed every 2 minutes and crawls the account
folders that changed. Android and iOS do the same in their 5-minute loop
through the bridge's new changed_shares. Public links have no feed and keep
the 6-hour recrawl.
2026-11-22 19:19:08 +01:00
nvrl 12aa7f18de Merge pull request #19 from narrrl/feat/flatpak
feat(packaging): Flatpak manifest and build script
2026-11-22 17:47:24 +01:00
nvrl 67d152980f Merge pull request #18 from narrrl/fix/sign-out-refresh-race
fix(core): don't store a refreshed session after sign-out
2026-11-22 17:47:14 +01:00
nvrl 14e64dbf9d Merge pull request #16 from narrrl/fix/android-armv7
fix(android): ship armeabi-v7a for 32-bit Android TVs
2026-11-22 17:46:50 +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 76ff90506c fix(android): ship armeabi-v7a for 32-bit Android TVs
Many Android TVs run a 32-bit userspace on a 64-bit SoC. The APK had only
arm64-v8a and x86_64 native libraries, so the package installer rejected
it there as "not compatible with your TV" before it ever ran.

libmpv (mpv-android's armv7l target), the Rust core (cargo-ndk) and the
JNI shim now build for armeabi-v7a too, and CI installs the
armv7-linux-androideabi Rust target. Adds about 43 MB to the APK.

Refs #5
2026-11-22 16:49:58 +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 1934f0e087 feat(packaging): Flatpak manifest and build script
The manifest builds the checkout offline on the GNOME 51 runtime, with
libass, libplacebo and libmpv as modules and every crate vendored through
cargo-sources.json. scripts/build-flatpak.sh regenerates the sources,
builds, optionally installs, and bundles into dist/.

Sandbox: network, Wayland with X11 fallback, DRI, PulseAudio, the Secret
Service, notifications and the MPRIS name. The screensaver inhibit goes
through the portal, which needs no extra permission.

Refs #3
2026-11-22 14:04:52 +01:00
nvrl 646db3a61b refactor(core): sign in through proton_sdk::login
proton-sdk 0.12.2 carries the sign-in steps, so account.rs uses
proton_sdk::login and stores from ResumeParameters; the stored layout is
unchanged. Share tokens come from the SDK's parse_public_link_url with
Stream's own messages; a link with an empty #fragment is now refused at
add time too.
2026-11-20 17:26:20 +01:00
nvrl fe93942420 refactor(core): sign in through proton_auth_rs::session
The sign-in steps (CAPTCHA retry, second factor, mailbox password, key
unlock) are now the sequence Proton Gallery and proton-drive-linux share.
The stored proton-account blob and its refresh write-back are unchanged.
2026-11-20 15:37:59 +01:00
nvrl c4b0165f7d feat: keep thumbnails and artwork in the shared picture cache
Proton thumbnails (desktop and Android) and provider artwork go through
pstr_core::pictures, a thin layer over proton-media-rs ImageCache: a
256 MiB budget each with least recently used eviction, entries a crash
cannot leave half-written, and hashed paths so no share id, link id or
URL reaches the filesystem. Before, both directories grew without limit
and the desktop wrote entries in place.

The stores live in cache/thumbnails and cache/artwork; the flat thumbs
and posters directories of earlier versions are deleted on first use,
so each picture is downloaded once more.
2026-11-20 14:18:57 +01:00
nvrl b23614f2ff refactor(stream): block maps, single flight and disk cache from proton-media-rs
pstr-stream keeps its BlockKey-keyed DiskCache as a thin wrapper over
proton_media_rs::DiskCache, with the node UID as the file identity, so
caches written by earlier versions are adopted unchanged.
2026-11-20 12:59:36 +01:00
nvrl 9cebd1fe0f refactor(core): keep secrets through proton-auth-rs; rusqlite 0.41
The desktop credential store is now proton-auth-rs, shared with
proton-drive-linux and Proton Gallery, instead of keyring 3 and a local
chunking module. It reads the entries keyring 3 wrote and the chunk
header this app wrote, so saved shares and the account session survive
the move. It also reconnects once when the Secret Service restarts.

KeyringSecretStore becomes pstr_core::keyring_secrets(), one store per
process. Android and iOS keep their own SecretStore through the bridge.

rusqlite goes from 0.32 to 0.41: the suite links one bundled SQLite.
2026-11-20 12:01:55 +01:00
nvrl 3d6aa3c64c feat(branding) logo + app icon 2026-11-18 01:44:14 +01:00
nvrl a475ad3575 docs: 2.0 screenshots of the library, the whole library and a title page 2026-10-31 14:38:47 +01:00