Commit Graph
100 Commits
Author SHA1 Message Date
LeoVasanko b6742f0f27 refactor: unify roots updates over single websocket 2026-05-31 00:26:51 +00:00
LeoVasanko 6d0e6d41a7 feat(media): use collection-based recommendations and refine poster display 2026-05-31 00:12:54 +00:00
LeoVasanko 932c5af1ff fix(frontend): scope synced row scrolling by group 2026-05-30 23:54:11 +00:00
LeoVasanko eb49eb713e Hide app scrollbars 2026-05-30 22:59:14 +00:00
LeoVasanko d7eea51334 Align custom access and websocket logging with paskia 2026-05-30 22:46:40 +00:00
LeoVasanko 01f424dbfb Force reel videos to remount on movie change 2026-05-30 22:33:23 +00:00
LeoVasanko df9025760d Add custom FastAPI access logging middleware 2026-05-30 22:25:21 +00:00
LeoVasanko 09e51acd14 Disable spellcheck and autocorrect in search input 2026-05-30 19:18:09 +00:00
LeoVasanko a029eabded Update README 2026-05-30 05:44:43 +00:00
LeoVasanko 4926b72167 Add adjacent detail navigation for keyboard and gamepad 2026-05-30 05:35:56 +00:00
LeoVasanko cd336d0bdb Add fixed-interval hold repeat for gamepad volume 2026-05-30 05:30:15 +00:00
LeoVasanko c75fb30921 Refine scan activity UI and initial-index visibility 2026-05-30 05:18:25 +00:00
LeoVasanko 28c50cab0b Enable SPA on backend (fix 404 accessing other than root) 2026-05-30 05:03:24 +00:00
LeoVasanko 14b76520a6 Stop eager reel loading in cards 2026-05-30 05:02:36 +00:00
LeoVasanko c9d2bcfdcc Fix frontend type mismatches 2026-05-30 04:52:59 +00:00
LeoVasanko 7a0247d78f Refine hover reel audio fades and idle behavior 2026-05-30 04:38:33 +00:00
LeoVasanko bb4bd3723f Improved serie episode preview video handling 2026-05-30 04:28:34 +00:00
LeoVasanko 7675940029 Implement JS-driven season poster sizing from episode grid remainder 2026-05-30 04:19:14 +00:00
LeoVasanko 613b516785 Fix series preview videos to render paused frames and stagger active season 2026-05-30 04:13:05 +00:00
LeoVasanko 2f72d1e7e2 Fix series full view vertical navigation to follow episode rows 2026-05-30 04:05:20 +00:00
LeoVasanko b51a7ea73d Separate scrolling for browse and details page even though they are laid out side by side on the layout (with one hidden out of screen). 2026-05-30 04:00:53 +00:00
LeoVasanko fe5be2087d Refine movie similar strip and desktop nav flow 2026-05-30 03:50:28 +00:00
LeoVasanko 46eecd8dbf Add related movies on Series page. Uses heuristics to show serie movies only. 2026-05-30 03:36:35 +00:00
LeoVasanko c2ee25ba3d Fix synced row deadzone behavior and isolate cast scroll metrics 2026-05-30 02:57:34 +00:00
LeoVasanko 649992a10a Align frontend with new cast and people wire format 2026-05-30 02:40:36 +00:00
LeoVasanko ada61e1400 Remove long hex root ids and use only friendly names 2026-05-30 02:28:58 +00:00
LeoVasanko 3551808351 Fix root-relative playable path normalization 2026-05-30 02:19:33 +00:00
LeoVasanko 0ef6896181 Refactor API to flat root routes and WS/meta structure 2026-05-30 02:09:24 +00:00
LeoVasanko 72963aeb7a Fix loading of index that was bad because of slop code. 2026-05-30 01:43:46 +00:00
LeoVasanko 352835a664 Add logical root asset URLs and harden media path serving 2026-05-30 01:36:47 +00:00
LeoVasanko 900fcea638 refactor index schema and metadata format and directory tree 2026-05-30 01:05:27 +00:00
LeoVasanko 550f67531a Faster startup by loading existing index without any checks, then incremental scanning to update. 2026-05-29 22:25:13 +00:00
LeoVasanko 25e9bab57b Improve scanner cancellation and offload heavy index I/O 2026-05-29 21:48:23 +00:00
LeoVasanko 359ca0c5b4 Add cross-platform system volume control with linear amplification mapping
- New mediahive/volume_control.py module controls master volume on
  Windows (IAudioEndpointVolume via ctypes), macOS (osascript), and
  Linux/PipeWire (wpctl).
- UI slider x in [0, 1.5] maps to linear amp via:
    amp = 0.02*x            if x < 0.1
    amp = (exp(6*x)-1)/402.42879349  otherwise
- PipeWire supports >100% amplification natively (up to x=1.5).
- Windows and macOS clamp at x=1.0 (100%) since their system mixers
  do not support amplification above unity.
- Gamepad D-pad up/down now controls system volume in 0.01 steps.
- JsApi exposes set_volume(), get_volume(), and volume_max() for the
  frontend to query platform limits and control volume directly.
- No external dependencies: uses ctypes on Windows, subprocess on
  Linux/macOS. No PulseAudio fallback.
- Add ruff ignore rules for ctypes COM boilerplate patterns.
2026-05-29 18:21:18 +00:00
LeoVasanko cac3348ec1 Fix detail-view focus scope and entry targets 2026-05-29 18:18:30 +00:00
LeoVasanko 0b3cd15589 feat: configurable media player selection with auto-detection
Backend:
- Add mediahive/players.py with cross-platform player detection:
  - Windows: MPC-BE, MPC-HC, VLC, PotPlayer, mpv (registry + known paths)
  - macOS: IINA, VLC (/Applications bundle scanning)
  - Linux: VLC, SMPlayer (PATH via which)
- Add GET /api/players endpoint returning detected players
- Extend POST /api/roots/{id}/play to accept player_id and player_custom_cmd
- Make MPC-BE web UI port configurable via ?port= query param

Frontend:
- Add player selection to settings (localStorage, per-client)
- Two-column layout: player list (9.5em) + contextual options panel
- Contextual options: Custom Command input, MPC Web UI Port input
- Empty MPC port disables all Web UI polling/connection attempts
- MPC-BE polling only runs when MPC family player is selected and port is set
2026-05-29 00:44:23 +00:00
LeoVasanko 17d9426d0a Fix scanner attach race during root activation 2026-05-27 22:05:37 +00:00
LeoVasanko ed4a5b2900 Route settings dialog to /settings and fix worker null handling 2026-05-27 21:58:09 +00:00
LeoVasanko 1383fc8da3 Add preferred format settings and release preference sorting 2026-05-27 21:52:36 +00:00
LeoVasanko fe71e1be8b Remove search worker debug logging 2026-05-27 21:23:48 +00:00
LeoVasanko a0d1433154 Switch SPA navigation to history paths 2026-05-27 21:21:49 +00:00
LeoVasanko 02a89aee68 Use /search/:term path-based search routing 2026-05-27 21:15:58 +00:00
LeoVasanko 29cda926a2 Improve search-detail back navigation and focus restore 2026-05-27 21:12:39 +00:00
LeoVasanko 81be850e0c Sliding layout between details and category views. 2026-05-27 20:58:19 +00:00
LeoVasanko e78774613a More compact and consistent layout for the release badges. Bluer release group color. 2026-05-27 20:50:43 +00:00
LeoVasanko 96c2d52ee0 perf(frontend): fix resource leaks and disable deep reactivity on media index
- useMediaWebSocket: shallowRef mediaIndex/tasks/loading/error/connected
  to eliminate Proxy overhead on the entire library data structure.
- useMediaWebSocket: replace per-task setTimeout leak with single 3s
  sweep interval for completed task cleanup.
- App.vue: remove {deep:true} watcher on mediaIndex; shallow ref change
  is sufficient to trigger search worker sync.
- useGamepadNavigation: rAF only when gamepads are connected; idle
  fallback to 500ms setTimeout to stop permanent 60fps CPU drain.
- useKeyboardNavigation: deduplicate synced scroll rAF requests to
  prevent overlapping animation frames.
- MediaDetail/SeriesFullView/CollageHero: pause, clear src, and load()
  video elements on unmount and before ref replacement to release
  decoder/memory resources.
- MediaDetail/SeriesFullView: clear all volume fade intervals on
  unmount to stop interval timer leaks.
2026-05-27 20:28:51 +00:00
LeoVasanko 79d3f40162 Unify gamepad repeat model with accelerating hold and analog scaling 2026-05-27 14:40:49 +00:00
LeoVasanko f982785850 Fix HexKeyboard X/Y gamepad keypress animations 2026-05-27 14:28:08 +00:00
LeoVasanko 4c33cee4ac Move frontend search to worker and improve people-name matching 2026-05-26 20:43:10 +00:00
LeoVasanko cf2b90809a HexKeyboard: refactor to row-based flex layout
Replace 39 per-key absolute positioning CSS rules with 4 row divs
using flexbox. Rows overlap via negative margin-top to preserve
honeycomb staggering. Horizontal offsets via 4 margin-left rules.

- Add RowKeyDef with globalIndex for row-based rendering
- Add rows computed to group layoutKeys into 4 arrays
- Remove all .hex-key-N { top; left } positioning rules
- Keys are now flex children, position: relative, fixed width

Also includes prior changes:
- Row-based greyscale gradients (lighter top, darker home row)
- Per-key re-triggerable press animation (DOM reflow reset)
- Green-to-white exponential fade on keypress
- Gamepad repeat: 90ms horizontal/buttons, 140ms vertical
2026-05-26 16:37:12 +00:00
LeoVasanko 43ca8ea1d1 Implement OSD keyboard for gamepads. Using hex tiles of course. 2026-05-26 04:52:13 +00:00
LeoVasanko 8cb7ab5938 Adjust no search results label. 2026-05-26 04:49:28 +00:00
LeoVasanko 7fa8ddad65 Fix movie details header layout and space division with cast display. 2026-05-25 19:21:21 +00:00
LeoVasanko f219840967 refactor(synced-scroll): rewrite with global metrics + per-row clamping
Replace the fragile per-row tail/maxVirtual state with a clean global-
metrics approach:

- Measure cardWidth, stride, paddingLeft, viewportWidth, rightDeadzone
  once from the first synced row; use the same values for all rows.
- Per-row max scroll computed purely from math:
    max(0, paddingLeft + (N-1)*stride - maxVisibleLeft)
  where maxVisibleLeft = viewportWidth - cardWidth - rightDeadzone.
- Global virtual offset (syncedRowsCurrentOffset/targetOffset) is shared
  across all rows; each row clamps independently in applySyncedRowScroll.
- Tail is a global constant (= rightDeadzone) applied to all rows.
- Fix scrolling-back bug: desiredOffset was stuck at currentOffset when
  moving left; now always computed from anchor column position.
- Avoid full animation sweep on view entry: init current/target offset
  from existing DOM scrollLeft on first use.

Also removes per-row --sync-row-max-virtual CSS var and simplifies
.media-row padding to use only --sync-row-tail.
2026-05-25 18:54:21 +00:00
LeoVasanko eee8c973ed fix: per-row tail padding for synced horizontal scroll
- Tail is now computed and applied per-row instead of globally.
- Right-side-only tail padding so item positions don't shift when tail grows.
- Removed anchor-row clamping from effectiveAnchorOffset and targetOffset;
  each row independently clamps the shared virtual offset.
- Rows that fit entirely on screen (maxOffset == 0) keep left alignment.
- Short rows retain their scrolled position when focus moves to longer rows.

Fixes erratic scrolling and zig-zag when navigating across rows of different
lengths in movie/series/search categories.
2026-05-25 17:30:06 +00:00
LeoVasanko a3f5ef5dac Smooth-scroll focused release items into view 2026-05-25 16:20:50 +00:00
LeoVasanko fbf35f7242 Refine movie detail cast rail and nav behavior 2026-05-25 16:18:35 +00:00
LeoVasanko ab1dfffdf3 Restore flex-based people layout in media cards 2026-05-25 15:45:13 +00:00
LeoVasanko 5b57640949 fix: clicking search result no longer redirects to category page
When clicking a search result, showDetail navigates to the detail page.
The route.fullPath watcher then clears searchQuery, which propagates to
Header's localSearch watcher, which emits @search='', which calls
updateSearchQuery(''). This in turn called clearSearch(), which did a
router.replace() to the category page because it didn't check whether
the current route actually had a search query.

The fix: in clearSearch(), if there's no search query in the current
URL, just clear reactive state and return without navigating. This
breaks the circular flow that was overwriting the detail-page
navigation.
2026-05-25 15:32:33 +00:00
LeoVasanko f484ab2606 Clean up movie details metadata layout 2026-05-25 15:24:05 +00:00
LeoVasanko 598cef8926 Adjust media row edge spacing without section padding 2026-05-25 14:57:42 +00:00
LeoVasanko f39473e26e Link header logo to front page 2026-05-25 14:52:36 +00:00
LeoVasanko 31fedcea6c Disable browser fullscreen auto-toggle 2026-05-25 14:49:31 +00:00
LeoVasanko b8cdd460b6 Scroll to view only on mouseup to avoid erratic scrolling during clicks. 2026-05-25 14:43:16 +00:00
LeoVasanko cfa1781192 refactor: hero featured item is a plain link like all other cards
Remove the separate Play and Info buttons from the CollageHero featured
item. All collage items (including the featured one) are now uniform
<a href> links that navigate to the detail page.

- CollageHero: remove hasResumePosition prop, play/info emits, and
  associated play button logic
- App.vue: remove @play and @info bindings from CollageHero
- Delete unused HeroSection.vue component and its styles
2026-05-25 14:25:58 +00:00
LeoVasanko 76c426546b refactor: media cards use proper <a href> links instead of JS navigation
MediaCard, MediaRow, CollageHero, HeroSection, and MediaDetail cast
cards now render as <a> tags with real hrefs. Modified clicks
(ctrl+click, middle-click) navigate natively, enabling open-in-new-tab
and link copying. Plain left-clicks continue through the existing
showDetail flow for side-effects like focus-state saving.
2026-05-25 14:21:13 +00:00
LeoVasanko 1d3d682b60 fix: don't steal focus from search input during focus restoration
When typing in the search bar on a detail page, navigating to search
results would trigger restoreFocusForPage(), which focused the 'last
viewed' card and interrupted typing. Skip focus restoration whenever
the search input is currently the active element.
2026-05-25 13:20:38 +00:00
LeoVasanko 0330a3023a frontend: clamp series hero synopsis to 10 lines 2026-05-25 13:11:12 +00:00
LeoVasanko 1cf3e6a08f frontend: place releases beside poster on narrow movie detail 2026-05-25 13:11:08 +00:00
LeoVasanko 17f8f60f6e fix: constant slant angle for season poster collage hero
The clip-path slant on collage slices previously varied with the number
of posters (hard-coded 10% steps). Express the slant as a percentage
of each slice's own width so the horizontal offset always equals the
fixed 5% container overlap, giving a constant angle for any count >= 2.
2026-05-25 13:02:15 +00:00
LeoVasanko 23379dc2c1 frontend: reduce movie detail poster width under 900px 2026-05-25 03:31:35 +00:00
LeoVasanko b1e775a29b Tuning server.run args for Windows: disable reloads (broken) and use Proactor loop regardless of dev mode. 2026-05-25 03:17:41 +00:00
LeoVasanko f6a40babc9 frontend: add OXC lint/format setup and apply semicolon fixes 2026-05-25 02:54:30 +00:00
LeoVasanko 836a563897 Pathlib fixes. Remaining errors to suppression for now. 2026-05-25 02:42:38 +00:00
LeoVasanko 17c5a47936 Misc. fixes #2. 2026-05-25 02:37:51 +00:00
LeoVasanko e86f1e22de Ignore copyright WTF rule and pylint complexity errors. 2026-05-25 02:32:08 +00:00
LeoVasanko 6646068adc Line too long errors 2026-05-25 02:27:39 +00:00
LeoVasanko 6115a3ff0a Misc. ruff fixes. 2026-05-25 02:22:55 +00:00
LeoVasanko 8d3e872d41 More ignores. 2026-05-25 02:21:44 +00:00
LeoVasanko 3768967e7d BLE001 except Exception replaced for more specific types. 2026-05-25 02:19:41 +00:00
LeoVasanko 54a4b57230 Unsafe fixes. 2026-05-25 02:12:31 +00:00
LeoVasanko 95081ca50e Suppress useless families. 2026-05-25 02:07:38 +00:00
LeoVasanko 0e5251ab91 Ruff automatic fixes and formatting. 2026-05-25 01:57:17 +00:00
LeoVasanko 5f69b5365f Add strict ruff config. 2026-05-25 01:55:51 +00:00
LeoVasanko b835b82e94 Add ETag and 10-minute cache for /api/media 2026-05-24 22:39:29 +00:00
LeoVasanko 93d89e32e2 Handle ffmpeg probe non-zero exits separately 2026-05-24 19:59:12 +00:00
LeoVasanko eeb28e991f Use Windows Shell API for reliable Explorer file selection
Use SHParseDisplayName + SHOpenFolderAndSelectItems to open the parent folder and select files with special-character paths. Keep explorer.exe /n,/select as a fallback when the API path fails.
2026-05-24 19:32:36 +00:00
LeoVasanko 780f223b82 Fix uvicorn forcing SelectorEventLoop on Windows dev mode
Uvicorn's asyncio_loop_factory returns SelectorEventLoop on Windows
whenever reload=True (use_subprocess=True). SelectorEventLoop does not
support asyncio subprocess APIs, causing NotImplementedError in the app.

Fix: pass loop='none' so uvicorn respects the ProactorEventLoop policy
we configure, instead of overriding it. Also suppress the Py3.14
DeprecationWarning on the policy class itself.
2026-05-24 19:14:31 +00:00
LeoVasanko 8586bd26e1 Remove PWA/SW and fix blocking startup I/O
- Remove vite-plugin-pwa and all service worker code. The app no longer
  registers a service worker; legacy SWs are unregistered on load.
- Move snapshot parsing (thousands of sync Path.exists() calls) into a
  thread pool via asyncio.to_thread() so the health check responds
  immediately on startup.
- Wrap aiopathlib AsyncPath.iterdir() (sync os.scandir under the hood)
  in asyncio.to_thread() in scanner and scanning modules so directory
  walks do not monopolize the event loop.
2026-05-24 19:01:13 +00:00
LeoVasanko b574c974a7 Harden ffmpeg subprocess handling and Windows loop policy 2026-05-24 18:06:07 +00:00
LeoVasanko 94f2f10dcd Fix root path handling and release action menus 2026-05-24 17:40:55 +00:00
LeoVasanko 487e410a8f Remove scrollbar. 2026-05-24 02:49:57 +00:00
LeoVasanko 36fc2a77d9 feat: merge duplicate items across roots with combined releases
- Add root_id to Torrent type for per-torrent root tracking
- Merge movies: combine all torrents, keep best metadata, sort by quality
- Merge series: combine seasons/episodes/torrents across roots
- Torrents are quality-sorted (resolution, HDR, DV, Atmos) across all roots
- App.vue play/openFolder use torrent-specific root_id when available
2026-05-24 02:37:09 +00:00
LeoVasanko 06565f688c feat: deduplicate movies/series across roots in merged index
Items with the same content hash from multiple roots are now shown as a
single card. When duplicates exist, the item with the best metadata
(info, cover, backdrop, showreels, torrent count) is displayed.
2026-05-24 02:24:36 +00:00
LeoVasanko 4097c3c9ac ui: replace folder dropdown with full-screen settings view
- Change header icon from folder to settings cog
- Replace roots dropdown panel with full-screen settings overlay
- Keep media roots as the only setting section for now
2026-05-23 22:23:16 +00:00
LeoVasanko 9c75fa4569 refactor: remove legacy single-root APIs, defer filesystem I/O, enforce POSIX paths
- Remove legacy endpoints: /api/change-folder, /api/index, /api/scan, /api/status,
  /api/playback/resume-positions
- Remove legacy global scanner module-level API from hivescan/scanner.py
- Defer all filesystem validation to background task in server lifespan (macOS-safe)
- CLI and winmain pass raw paths via MEDIAHIVE_ROOTS; no pre-startup validation
- Enforce POSIX paths everywhere (as_posix(), no backslash leakage)
- Remove MEDIAHIVE_PATH and MEDIAHIVE_DEFER_INITIAL_ROOT env vars
- Update frontend api.ts to use per-root resume positions
- Update docs/API.md and docs/multi-index-plan.md
- Fix Python 2 style except clauses in hivescan/utils.py and scanning.py
2026-05-23 22:21:35 +00:00
LeoVasanko 2f83193ff4 fix: use html classes instead of :global() for input modality styles
The :global() pseudo-class in Vue scoped SFC styles was being mangled
by the Vue compiler, producing broken CSS that applied properties like
z-index and opacity directly to the <html> element and dropped the
intended component selectors entirely.

Replace the html[data-mouse-active] / html[data-pointer-visible] data
attribute approach with plain CSS classes (mouse-active, pointer-visible)
toggled on document.documentElement. In Vue scoped styles, prefixing a
selector with html.mouse-active or html:not(.mouse-active) compiles
correctly — the html part stays global while the component selector
receives the scoped attribute — avoiding :global() entirely.

This keeps all component styles inside <style scoped> and fixes the
layout breakage caused by the original commit.
2026-05-23 21:57:59 +00:00
LeoVasanko 79dc1b25cc Fix search exit flow and history behavior 2026-05-23 20:33:48 +00:00
LeoVasanko 0f404e5e53 Refine input modality to prevent hover/focus highlight conflicts 2026-05-23 18:58:53 +00:00
LeoVasanko 075f6a50cc fix: kill ffmpeg on cancellation and use POSIX paths everywhere
Bug 1 (shutdown hang):
- Add _kill_proc() helper to force-kill ffmpeg subprocesses immediately
  when a showreel generation task is cancelled or fails.
- Unlink the incomplete output file after killing the process.
- Applies to both generate_showreel_images() and generate_episode_reel().

Bug 2 (path inconsistency):
- Use .as_posix() instead of str() for all persisted and stored paths
  across the codebase (config, env vars, index store, API responses,
  torrent paths, playable files, cover images, episode reels, etc.).
- Ensures forward slashes are used exclusively even on Windows.

Files changed:
- mediahive/hivescan/showreel.py
- mediahive/server.py
- mediahive/hivescan/scanner.py
- mediahive/hivescan/scanning.py
- mediahive/hivescan/indexer.py
- mediahive/hivescan/images.py
- mediahive/hivescan/__main__.py
2026-05-23 18:36:43 +00:00