Commit graph

211 commits

Author SHA1 Message Date
KhooLy
5e7df0002c Bind telemetry to playback sessions 2026-08-01 21:09:47 +03:00
KhooLy
f74be653a7 fix: advance desktop telemetry attempts 2026-08-01 19:26:28 +03:00
KhooLy
9f86056f79 fix: reset desktop torrent telemetry sessions 2026-08-01 19:13:39 +03:00
KhooLy
e8e70ac3eb chore: consolidate desktop updates 2026-08-01 18:53:50 +03:00
KhooLy
b213bb0221 Complete torrent playback lifecycle wiring 2026-08-01 16:24:03 +03:00
KhooLy
5e6127ed0b Pass torrent duration to streaming scheduler 2026-08-01 16:04:32 +03:00
KhooLy
5f6ecc8f37 Preserve desktop torrent cache 2026-08-01 15:24:21 +03:00
KhooLy
534f3247dc fix isolate thumbnail renderer state 2026-08-01 14:50:59 +03:00
KhooLy
5f7efe349d refactor desktop state boundaries 2026-08-01 14:43:41 +03:00
KhooLy
ad4ff1d115 perf: split player status events 2026-07-31 22:07:31 +03:00
KhooLy
8b1c69fdf9 perf: reduce player telemetry work 2026-07-31 21:59:10 +03:00
KhooLy
0d09970d3d feat: make Sentry crash reporting opt-in via Diagnostic Mode toggle
Sentry previously initialized unconditionally in release builds. Now it
only starts when the user enables Diagnostic Mode, and shuts down when
they disable it. Also drops the stdout log target in release builds —
console output is invisible to users running the packaged app anyway.
2026-07-31 19:40:49 +03:00
KhooLy
53b8fe196c feat: add Stable Volume setting to normalize loud/quiet audio via mpv dynaudnorm filter 2026-07-31 17:22:21 +03:00
KhooLy
48623de870 fix(macos): mark extern C blocks unsafe for edition 2024, fix mismatched-type build error
ci: retry VLC checksum verification since get.videolan.org round-robins mirrors
2026-07-30 22:13:58 +03:00
KhooLy
7d5989bfd7 chore: bump version to 0.1.30 2026-07-30 21:23:33 +03:00
KhooLy
abf3a23f83 fix: import DesktopState in storage.rs
Windows build broke after the lib.rs split moved DesktopState without
updating this reference.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-30 20:40:12 +03:00
KhooLy
c2da5923e9 fix: bump tauri to 2.11.5, gate Linux resize handler on decorations
tauri-runtime-wry's undecorated_resizing::attach_resize_handler was
attached unconditionally for every webview on Linux (unlike Windows,
which already checks !window.is_decorated()), and its hit-test
handler assumes the GTK widget tree is always exactly
webview -> parent -> window. With transparent windows the tree has
an extra GtkBox layer, so the downcast .unwrap() panics and aborts
the whole process on resize.

Since this app always runs with decorations: true and never toggles
them, port the same !window.is_decorated() gate Windows already uses
into a fresh local patch against tauri-runtime-wry 2.11.4, which lets
the app move to tauri 2.11.5. The crash no longer reproduces
(verified against vanilla 2.11.4 first).
2026-07-30 19:59:58 +03:00
KhooLy
77f69fe099 fix: don't mark first frame presented while a resume seek is pending
report_swap() flipped first_frame_presented as soon as any frame
rendered, even the pre-seek frame 0 mpv holds while paused waiting
for the resume position to land. The frontend uses that flag to
dismiss the loading overlay, so resuming from continue watching
flashed the video's first frame before jumping to the saved position.
Gate it the same way restore_audio_after_first_presented_frame()
already does.
2026-07-30 19:58:41 +03:00
KhooLy
0b666ed64a refactor: split lib.rs into core_commands, oauth_callbacks, and torrent modules
Move Tauri command handlers for core IPC, OAuth callback queuing, and
torrent streaming/transport out of lib.rs into dedicated modules, and
fold plugin_runtime into a single plugin_executor module now that it's
just the scraper execution path.
2026-07-30 14:16:19 +03:00
KhooLy
ddd808957b refactor: split storage.rs into library_*_storage and storage_kv modules
Separate the SQLite-backed progress/history/collections tables and the
generic key-value store from storage.rs, which had grown to cover
encryption, migrations, and every table's CRUD in one file.
2026-07-30 14:16:11 +03:00
KhooLy
ca74da9ade refactor: split player.rs into player/ submodules
Break the Tauri player commands into lifecycle, controls, presentation,
and state-tracking modules, following the same pattern already applied
to mpv_render and linux_vulkan.
2026-07-30 14:16:03 +03:00
KhooLy
fb8f84b72e fix: expose mpv seeking status and tighten cache defaults
Report mpv's `seeking` property in PlayerStatus for both mpv and libvlc
engines, and lower cache-secs/demuxer-max-bytes/readahead so playback
starts and reacts to seeks faster.
2026-07-30 14:15:46 +03:00
KhooLy
cdf69b06f5 refactor: extract SurfaceTick struct from linux_player_surface's install()
install()'s glib::timeout_add_local callback was a single ~300-line
closure because GTK's timer API only takes one FnMut, so all per-tick
mutable state (pending_load, latch_grace_ticks, chapters_native_loaded,
transparency_reassert_ticks, screenshot_countdown_ticks/seq, vulkan_state,
visible) got closure-captured as locals instead of living somewhere named,
and five unrelated concerns — draining SurfaceCommands, warming up the
render context, retrying a deferred load, and per-frame housekeeping —
ended up inline in one body.

Extracted a SurfaceTick struct owning that state, with one method per
concern (drain_commands, warm_up_render_context, retry_pending_load,
run_frame_tasks) and on_tick() as a thin dispatcher. install()'s closure
is now `move || tick.on_tick()`; the function itself drops from ~410 to
~140 lines.

This is a real restructuring, not a pure relocation (closure captures
became struct fields, one nested closure needed explicit reference
locals to satisfy the borrow checker) — verified with cargo check, but
unlike the mpv_render.rs/linux_vulkan.rs splits this touches the actual
render-loop control flow (GTK tick timing, Vulkan warmup handshake,
WebView transparency reassertion) which cargo check cannot behaviorally
verify. Needs a real playback smoke test (OpenGL and Vulkan backends,
X11 and Wayland) before trusting it in production.
2026-07-30 03:45:32 +03:00
KhooLy
f5aedac0b5 refactor: split VulkanContext's impl block across linux_vulkan/ submodules
linux_vulkan.rs's single impl VulkanContext spanned ~840 lines. Split
into three sibling submodules under linux_vulkan/, same file+dir mod
pattern used for mpv_render/: init.rs (new() bootstrap + Drop teardown),
swapchain.rs (semaphore/command-buffer/swapchain creation + resize),
render.rs (frame acquire/submit/present loop + accessors).

create_semaphores, create_command_buffer, create_swapchain needed
pub(super) since new() (in init.rs) and recover_after_render_error()
(in render.rs) call them across the new file boundary.

No logic changed — verified with cargo check.
2026-07-30 03:35:14 +03:00
KhooLy
b5085abee2 fix: use mpv's async command dispatch for fire-and-forget renderer calls
Several internal mpv commands were sent via command_string/command, which
call mpv_command_string/mpv_command — synchronous mpv API calls that
block the caller until mpv's core acknowledges them. These particular
call sites already discarded the result (`let _ = ...`) and run inside
render/event loops (poll_events, the surface command loops in
*_player_surface.rs) or the Windows mute-restore path, so there was
nothing gained from waiting: mute-restore, seek-restart, pause-resume,
stop, and the debug screenshot-to-file path now go through command_args
(mpv_command_async), which enqueues and returns immediately; the reply
arrives later via poll_events' MPV_EVENT_COMMAND_REPLY handling, which
was already dropped.

Left load(), seek_to(), and user_command() on the synchronous path —
those propagate a Result the frontend actually uses for error feedback
(failed loadfile, failed seek, failed user-triggered command), so
switching them to fire-and-forget would silently swallow real errors.

Verified with cargo check on Linux. macos_player_surface.rs and
windows_player_surface.rs changes are the same one-line substitution
but unverified — this machine only compiles the Linux target.
2026-07-30 03:31:41 +03:00
KhooLy
40f5fd7981 refactor: split MpvRenderer's impl block across mpv_render/ submodules
mpv_render.rs's single impl MpvRenderer spanned ~1250 lines. Split into
five sibling submodules under mpv_render/, following the same file+dir
mod pattern already used for api.rs and platform_gl.rs (and for player.rs
elsewhere in this codebase): lifecycle.rs (construction/loading/Drop),
commands.rs (low-level mpv command dispatch), context.rs (render-context
creation across sw/GL/Vulkan/D3D11 backends), frame.rs (per-frame
rendering + swap/audio-restore), status.rs (event polling, status
snapshot, track enumeration, property getters).

A few methods called across the new file boundaries needed pub(super)
instead of private visibility (create_software_context,
create_opengl_context, ensure_buffer, get_string_property,
track_list_status, restore_audio_only) since Rust's default privacy is
visible to the defining module and its descendants, not to siblings.
mpv_render.rs itself now only holds the FFI type/struct/const
definitions, PlayerStatus's small accessor impl, and the
library-loading helpers. No logic changed — verified with cargo check.
2026-07-30 03:25:21 +03:00
KhooLy
1d933cdf65 feat: proxy stream requests locally to surface real upstream errors
Route playback URLs through a local 127.0.0.1 proxy so failed streams
report the actual upstream HTTP status/body instead of a generic mpv error.
2026-07-29 16:33:04 +03:00
KhooLy
1552379ac9 refactor: delegate scrobble threshold, subtitle matching/dedup to fluxa-core
Trakt/SIMKL scrobble-close threshold, torrent sibling-subtitle matching,
and subtitle language dedup were duplicated logic living in the desktop
shell; route them through fluxa_core so mobile doesn't have to reimplement
the same policy.
2026-07-29 16:22:38 +03:00
KhooLy
eea1e37ed5 fix(desktop): serialize Anime4K commands on Windows 2026-07-29 16:18:36 +03:00
KhooLy
706739dcfc feat(player): show HDR badge in player header when playing HDR content
Surfaces the renderer's active HDR state (mpv/libvlc) through player
status into an HDR10/HLG badge next to the title in the player header.
2026-07-28 21:28:23 +03:00
KhooLy
c55e40fdbc fix(desktop): hide in-app updater when installed via a system package manager 2026-07-28 15:43:50 +03:00
KhooLy
a0b9b5d14d chore: bump to Rust edition 2024, update GitHub Actions to latest majors
Some checks failed
Warm Windows ANGLE Cache / warm-angle-cache (push) Has been cancelled
2026-07-28 15:27:42 +03:00
KhooLy
f64f653d74 fix(desktop): merge duplicate subtitle language groups, fix Anime4K toggle revert
Subtitle track grouping keyed on the raw mpv lang code, so "eng" (external
OpenSubtitles subs) and "en" (embedded ass tracks) showed as two separate
English entries instead of one. Group by display name instead.

player_set_anime4k_enabled could fail with "player renderer busy" when
hwaccel is degraded and the render loop holds the renderer lock longer
than the previous 300ms retry budget, causing the UI toggle to silently
revert. Raised the retry budget and logged failures for diagnosis.
2026-07-27 17:26:48 +03:00
KhooLy
317b5bb681 chore(desktop): sync Cargo.lock version after merge (0.1.29) 2026-07-27 16:38:28 +03:00
KhooLy
90a35244bf Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src-tauri/src/oauth.rs
2026-07-27 16:37:58 +03:00
KhooLy
bdeea190d1 feat(desktop): HDR display output support (Windows)
- windows_d3d11.rs / windows_player_surface.rs: detect whether the
  active display supports HDR and, when the "HDR output" preference is
  on, create the D3D11 swap chain with an HDR-capable format; expose
  hdr_display_supported() for the frontend to query.
- mpv_render.rs: drop the now-redundant format/width/height fields
  from the D3D11 render target — mpv_d3d11_fbo only needs the texture,
  which already carries its own format/dimensions.
- linux_player_surface.rs: track whether the current Vulkan context is
  HDR-capable on a shared flag for parity with the Windows path.
- storage.rs: add read_pref_bool() to read boolean prefs (used for the
  hdrEnabled toggle).
- lib.rs: register the player_hdr_supported command; tauri.conf.json
  sets a transparent window background so HDR/SDR compositing doesn't
  show a black flash.
- Frontend: add an "HDR output" toggle in Playback settings, auto-detect
  and store display support on first run via player_hdr_supported.
2026-07-27 16:17:18 +03:00
KhooLy
0dbdafd066 feat(desktop): find and load torrent-bundled subtitle files, richer mpv track logging
- mpv_render.rs: enable "info"-level mpv logging and route messages to
  the matching Rust log level with prefix/level context; use mpv's
  native int64/flag property getters (get_i64_property/
  get_flag_property) instead of parsing track-list strings, and log
  each queried track (id/title/lang/codec/selected/external) to make
  subtitle-track issues diagnosable from the app log.
- player.rs: wire up the previously-unused torrent_sibling_subtitles
  scan as a new player_torrent_sibling_subtitles command — finds
  subtitle files (.srt/.ass/.ssa/.vtt/.sub) bundled in the same torrent
  as the playing video, matching by exact filename, by a shared
  S01E02-style episode tag, or (for single-video torrents) by being
  the only video in the release.
- lib.rs: register the new command, elevate "subtitles:" debug_log
  lines to warn so they're visible without FLUXA_DEBUG_LOGS, and make
  torrent_engine_request pub(crate) so player.rs can call it.
- usePlayer.ts: load resolved subtitles into mpv one at a time (was
  all at once), which was triggering 429s from subtitle CDNs; merge in
  the torrent-bundled subtitles found above.
- mpvPlayer.ts: add the player_torrent_sibling_subtitles wrapper.
- subtitles.ts: trace addon subtitle resolution via debug_log, and cap
  addon results to 2 per language (OpenSubtitles returns dozens of
  near-duplicates).
2026-07-27 16:16:29 +03:00
KhooLy
9741d0d44c chore(desktop): refresh Cargo.lock for dropped rquickjs bindgen feature
Downstream of the fluxa-core rquickjs "bindgen" feature removal —
prunes bindgen/cexpr/clang-sys and their transitive deps from the lock
file (avoids requiring libclang to build).
2026-07-27 16:14:30 +03:00
KhooLy
6087dcdf97 feat(desktop): embed libVLC playback instead of a separate window
- libvlc_render.rs: locate/load libvlc more robustly (Windows DLL
  search path, plugin path discovery), route libvlc log messages into
  the app logger, lazily create the media player, and add audio
  mute/track and subtitle-track control bindings.
- macos_player_surface.rs: attach the libVLC output to the native
  NSView so it renders inside the app window (macOS), switching
  between the Vulkan and libVLC render paths based on the active
  engine.
- Update the player-engine description strings to reflect that libVLC
  now renders embedded rather than in its own window.
2026-07-27 16:13:03 +03:00
KhooLy
6c1bc94a07 style: run rustfmt over backend Rust modules
Whitespace/line-wrap only (rustfmt default width) across the
libmpv/plugin-runtime backend files; no behavior changes.
2026-07-27 16:12:54 +03:00
KhooLy
6e11fc679a Release v0.1.29 with mpv gpu-next.17 2026-07-26 18:58:50 +03:00
KhooLy
5de8168bbf Complete external sync and calendar integration 2026-07-26 17:15:02 +03:00
KhooLy
52284c53f8 fix(windows): synchronize native player controls and status 2026-07-26 14:48:01 +03:00
KhooLy
f357af0d9e Add profile picker customization and recommendation sources 2026-07-26 03:13:56 +03:00
KhooLy
7ae9919546 Fix mpv first-frame audio handoff 2026-07-26 02:36:00 +03:00
KhooLy
3e7b8d062e feat: add provider library sources and sync fixes 2026-07-26 01:09:30 +03:00
KhooLy
b9e7e6f805 Fix desktop OAuth callback handoff 2026-07-26 00:29:40 +03:00
KhooLy
4f21ab1566 fix: expose platform GL resolvers 2026-07-22 22:53:50 +03:00
KhooLy
dd8ab61eae fix: compile platform GL bindings 2026-07-22 22:20:03 +03:00
KhooLy
4eb0f54b8c fix: restore Windows and macOS builds 2026-07-22 21:41:47 +03:00