Commit Graph

105 Commits

Author SHA1 Message Date
Garret Patti
a379e94bce media viewer consistency 2026-04-14 18:45:06 -04:00
Garret Patti
0b03b937e0 update dockerfile
All checks were successful
Build and Push Docker Image / build (push) Successful in 54s
2026-04-14 08:31:30 -04:00
Garret Patti
19756c9eab docker fixes
All checks were successful
Build and Push Docker Image / build (push) Successful in 56s
2026-04-14 08:25:12 -04:00
b25774d928 Merge pull request 'responsiveness' (#26) from responsiveness into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 54s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/26
2026-04-14 02:14:02 +00:00
Garret Patti
db2e446ef4 feat: per-extraction OCR language override
Allow users to specify a Tesseract language string (e.g. jpn+jpn_vert)
on a per-extraction basis, overriding the global OCR language setting.

- Add payload column to ai_jobs table (migration) to carry per-call data
- Thread ocrLanguages payload through enqueueJob → processNextJob → extractItemText
- New GET /api/ai-settings/ocr endpoint (requireAuth) returns { ocrMode, ocrLanguages }
- ImageLightbox fetches OCR settings and shows a language input next to the
  Extract Text button when mode is hybrid or tesseract (hidden for llm-only)
- MixedView fetches OCR settings and passes them down to EntryTile; kebab
  Extract Text on images shows an inline language prompt before dispatching the job

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 21:55:07 -04:00
Garret Patti
96cfb8aae7 UI polish: live job polling, panel layout, pending button states
- Poll /api/ai-tagging/fields every 2s after any 202 (queued) response in
  ImageLightbox and DoomScrollView so extraction, translation, and description
  results appear automatically without a page refresh
- DoomScrollView extract button now turns accent-coloured while a job is
  queued instead of flashing red; red is reserved for genuine errors
- Kebab menu "Translate" option is now gated on entry.hasExtractedText
  (populated via a batch DB query in the browse API) so it only appears
  when there is text to translate
- Tag panel redesigned: toolbar collapses to just the filename when open;
  panel header holds hide (›), AI Tagger (), and Close (✕) buttons;
  sections ordered Description → Text Extraction → Tags; description
  state and generate handler moved from TagSelector into ImageLightbox
- VideoPlayerModal receives the same toolbar/panel restructure
- TagSelector gains hideDescription prop so the parent can own description

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 20:37:20 -04:00
Garret Patti
d754f85717 update gitignore 2026-04-13 19:45:20 -04:00
9d73459f48 Merge pull request 'customize-context-length' (#25) from customize-context-length into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m7s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/25
2026-04-13 23:41:09 +00:00
Garret Patti
9b2690f639 add tesseract ocr 2026-04-13 19:40:25 -04:00
Garret Patti
1350a6f94b separate text extraction and translation 2026-04-13 17:45:00 -04:00
Garret Patti
2fc9a34626 add configurable max_tokens per AI activity
Allows users to configure the max_tokens sent to the AI endpoint for
each activity (tagging, description, extraction, translation) individually,
with per-library overrides following the same pattern as model overrides.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 13:57:07 -04:00
236f168eeb Merge pull request 'text-extraction-improvements' (#24) from text-extraction-improvements into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 9s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/24
2026-04-13 16:29:25 +00:00
Garret Patti
fea55594d0 add ai job queue 2026-04-13 12:29:09 -04:00
Garret Patti
8557c80c52 reduce api calls for text extraction 2026-04-13 11:18:39 -04:00
Garret Patti
68b1ed94ea fix vertical image clipping in viewer 2026-04-13 10:53:05 -04:00
Garret Patti
e31a9667ef text extraction improvements: editable text and source language hint
- Extracted text in the tag panel is now an editable textarea; a Save
  button appears when the content is dirty and persists edits to the DB
- Source language input added next to Re-translate button; when filled,
  the translation prompt uses "translate from X to Y" for more accurate
  results
- New updateExtractedText() helper and PATCH /api/ai-tagging/fields
  endpoint to support saving edited text
- translateItemText/translateText accept optional sourceLanguage param

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 10:29:47 -04:00
c454d020da Merge pull request 'doomscroll-improvements' (#23) from doomscroll-improvements into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 54s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/23
2026-04-13 13:23:33 +00:00
Garret Patti
b0fc275a52 add extract text button to doom scroll mode
Show an extract-text button (document icon) in the bottom bar when the
current image has no extracted text yet. Clicking it calls the extract-text
API, shows a spinner while in progress, and on success replaces itself with
the text-lines display button and auto-opens the overlay. Error state briefly
turns the button red. Resets on every item navigation alongside the other
text state. Hidden for videos and items without an itemKey.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 09:19:32 -04:00
Garret Patti
cd9a83ea90 send higher resolution images to AI vision endpoints
Add getAiImagePath() to thumbnails.ts (1920px wide, quality 90, no
upscaling) cached separately from display thumbnails via an _ai suffix.
Swap all four image-to-AI code paths in ai-tagger.ts (extract text,
describe, batch tagging x2) to use the new high-res image instead of
the 400px display thumbnail, improving OCR accuracy on dense text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 09:08:43 -04:00
Garret Patti
5ba73b2e56 doom scroll and viewer improvements
- move play/pause to clicking the video directly; remove dedicated button
- replace emoji mute icons with flat minimal SVGs
- add view-in-library button in doom scroll that navigates to the file's
  directory and opens it in the regular viewer
- add display text overlay button in doom scroll and image lightbox;
  shows extracted text (translated by default when available) in a
  semi-transparent box at the bottom; toggle between translated/original
- hide tag panel by default in image lightbox and video player modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 08:16:34 -04:00
2b51f72f96 Merge pull request 'ai-customization' (#22) from ai-customization into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 52s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/22
2026-04-13 01:13:41 +00:00
Garret Patti
efaff8ca1b add applied tags as context to description prompt
When generating an item description, any already-applied tags are
appended to the system prompt as a source of truth, so the model
can produce a more accurate description aligned with existing tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 21:12:58 -04:00
Garret Patti
89ac22e9d1 show applied tags first in tag selector picker
Applied tags are now pinned to the front of each category's tag list,
with unapplied tags continuing in usage order behind them. Both
partitions preserve the existing usage-sort from the API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 20:58:12 -04:00
Garret Patti
b0d146679f scope doom scroll to current directory when no filters active
When no filters are selected, doom scroll now recursively fetches only
items under the current directory instead of the entire library root.
Navigating to a new directory invalidates the cached listing. Filter-
based doom scroll (search or tags) continues to search library-wide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 20:51:29 -04:00
Garret Patti
887cc05901 add per-library AI model and prompt customization
- Add library_ai_settings table with migration for per-library overrides
- Extend AiConfig with editable prompt parts for description, tagging,
  extraction, and translation steps; defaults match previous hardcoded values
- Add getEffectiveAiConfig(libraryId) that merges global settings with
  library-level overrides (empty override falls through to global)
- Update all ai-tagger functions to use getEffectiveAiConfig and build
  prompts from configurable parts
- Add GET/PUT /api/ai-settings/library/[id] for per-library overrides
- Update /api/ai-settings GET/PUT to include prompt fields
- Add Prompts section and Library Overrides section to admin UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 20:37:11 -04:00
afb9540df2 Merge pull request 'ai-descriptions' (#21) from ai-descriptions into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 52s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/21
2026-04-12 23:55:05 +00:00
Garret Patti
5ac4b3bd8a customize model based on step 2026-04-12 19:50:18 -04:00
Garret Patti
470f34c985 feed extracted text to image tagger prompt 2026-04-12 19:15:19 -04:00
Garret Patti
7e284383b4 add ai descriptions and extracted text 2026-04-12 18:18:59 -04:00
60790a3af1 Merge pull request 'ai-feature-setup' (#20) from ai-feature-setup into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 51s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/20
2026-04-12 21:24:57 +00:00
Garret Patti
6c769b457f handle video tagging 2026-04-12 17:24:39 -04:00
Garret Patti
ad9920a448 limit tags sent and send applied tags to ai 2026-04-12 16:45:26 -04:00
Garret Patti
732e9134c3 ai starter implementation 2026-04-12 15:39:48 -04:00
Garret Patti
0238dbda7a Add AI-powered image tagging via local LLM
Adds automatic image tagging that runs as a post-scan phase, sending
thumbnails to an OpenAI-compatible vision API and applying matching
tags from the user-defined tag vocabulary.

- New ai-tagger module with batch processing, failure tolerance, and
  tag validation against existing vocabulary
- Admin settings page (Manage > AI Tagging) for endpoint, model, and
  enable toggle with connection testing
- DB migration for ai_tagged_at tracking column and AI config seeds
- Re-tag All support to queue items for reprocessing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 15:18:03 -04:00
9bff0f848a Merge pull request 'add individual library scanning' (#19) from scanner-improvements into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 53s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/19
2026-04-12 18:10:13 +00:00
Garret Patti
aae41e9803 add individual library scanning 2026-04-12 13:51:51 -04:00
7e9ba6e014 Merge pull request 'add-android-platform' (#18) from add-android-platform into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 51s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/18
2026-04-12 17:09:29 +00:00
Garret Patti
0091606e4d handle other archive types for linux 2026-04-12 13:09:07 -04:00
Garret Patti
080cc011b9 icon color and size tweaks 2026-04-12 12:41:42 -04:00
Garret Patti
d3e1bf049b handle android and swap to os icons 2026-04-12 11:53:27 -04:00
625539f35e Merge pull request 'game-enhancements' (#17) from game-enhancements into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m4s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/17
2026-04-12 14:19:51 +00:00
Garret Patti
84c65c7964 Add screenshots to game detail modal
- New /api/game-screenshots route handles GET (list), POST (upload), and DELETE (remove single file)
- Screenshots stored in a screenshots/ subfolder inside each game directory
- Images converted to JPEG via Sharp on upload, named shot-{timestamp}.jpg
- Modal shows a horizontal scrollable strip of 16:9 thumbnail tiles
- Hover a tile to reveal a delete button; uploading placeholders appear per in-flight upload
- Dashed + tile triggers multi-file picker for batch uploads
- Click any thumbnail to open a full-screen lightbox with prev/next arrows, counter, and keyboard nav (←/→/Esc)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 10:18:38 -04:00
Garret Patti
53205d4a19 Add multi-platform game support with per-OS download detection
- Detect Windows (.zip), Linux (.tar.gz), and macOS (.dmg / .app bundle) game archives during scan
- Store GameFile[] with platform metadata in DB instead of plain zipFiles[]
- Stream .app bundles as on-the-fly zip archives via archiver
- Show WIN/LIN/MAC platform badge pills on GameCard and SeriesCard
- Auto-select the download matching the user's OS in GameDetailModal
- Persist cover URL to DB immediately on upload (no re-scan needed)
- Backward-compatible: legacy zipFiles entries map to platform 'windows'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 09:47:09 -04:00
ebc35d7184 Merge pull request 'add more management capabilities' (#16) from management into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 52s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/16
2026-04-11 22:34:38 +00:00
Garret Patti
768c49ef00 add more management capabilities 2026-04-11 18:33:03 -04:00
1ca90184f5 Merge pull request 'clean-up' (#15) from clean-up into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m42s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/15
2026-04-11 01:33:10 +00:00
Garret Patti
6c2443fa2c Filter non-browser-playable formats from Doom Scroll
Formats like .mkv, .avi, .wmv, .ts, .m2ts and .tiff are not natively
supported by browsers and would stall silently in Doom Scroll mode.

Add src/lib/browser-media.ts with BROWSER_VIDEO_EXTENSIONS (.mp4,
.webm, .mov, .m4v), BROWSER_IMAGE_EXTENSIONS (.jpg, .jpeg, .png, .gif,
.webp, .bmp), and an isBrowserPlayable() helper that extracts the
extension without importing Node's path module.

Filter doomScrollItems in MixedView, MoviesView, and TvView using this
helper so only natively renderable files are passed to DoomScrollView.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 21:29:17 -04:00
Garret Patti
5d4d11512d Fix DoomScrollView going blank after 100 items
When history hit the 100-entry cap, setHistory sliced the array back to
indices 0–99 but setHistoryIndex still returned idx + 1 = 100, making
current = history[100] = undefined. Nothing rendered and no API calls
were made until the user went back (decrementing to index 99, which
held the newly-picked item).

Fix: cap the returned historyIndex at HISTORY_CAP - 1 so it always
points to a valid entry in the sliced array. Extract HISTORY_CAP = 100
as a named constant so the slice and the index cap stay in sync.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 21:13:06 -04:00
Garret Patti
6f86750a99 Unify media_key and item_key — use item_key everywhere
media_key was a lossy shortening of item_key (libraryId:lastSegment) that
introduced a real collision bug: two TV episodes from different series with
the same filename would share the same media_key and each other's tags.

- DB migration converts existing media_tags rows from short format to full
  item_key by joining against media_items; ambiguous/orphaned rows are dropped
- media_tags column renamed media_key → item_key
- Removed itemKeyToMediaKey() from scanner; reconcileAndPrune now passes
  item_key directly to reKeyMediaItem
- DB reader functions (tv, movies, games) now expose item_key on returned
  entities; frontend components use entity.item_key instead of constructing
  the short libraryId:id form
- MixedView now constructs the full mixed_file: item_key format
- Tag API renamed mediaKey param → itemKey throughout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 18:04:29 -04:00
390ce8fcc6 Merge pull request 'performance-stability' (#14) from performance-stability into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 50s
Reviewed-on: http://gitea.lan/gpatti/MediaLore/pulls/14
2026-04-07 00:22:00 +00:00