Commit Graph

125 Commits

Author SHA1 Message Date
Claudio Ortolina ff3f809c2c ML-170: add enrichment fields to collection API
Add MusicLibrary.Collection.Enrichment module with batch scrobble, artist
country, and selected release enrichment from existing tables.

Wire enrichment into all four collection API endpoints (index, latest,
random, on_this_day). New JSON fields: scrobble_count, last_listened_at,
artist_country, selected_release.

Uses 3 fixed-count batch queries regardless of page size — no N+1 risk.
No schema changes or migrations required.
2026-05-22 13:21:14 +01:00
Claudio Ortolina d8a67cd475 ML-181: harden assets endpoints 2026-05-22 08:20:35 +01:00
Claudio Ortolina 5212b8607e Reduce api medium cover size to 400px 2026-05-16 17:46:47 +01:00
Claudio Ortolina b4710e10c8 ML-185.1: expose named cover sizes in collection API 2026-05-15 22:49:06 +01:00
Claudio Ortolina 8391cf275a ML-180: remove backup download feature
Delete ArchiveController, its routes, the maintenance UI backup
button, and the test file. Management scripts and Litestream
supersede this functionality.
2026-05-15 07:13:33 +01:00
Claudio Ortolina e1943ff030 Invert conditional and use existing functions 2026-05-11 15:03:55 +01:00
Claudio Ortolina ba62d54cc5 ML-177: implementation 2026-05-10 20:39:18 +01:00
Claudio Ortolina a3bc6d7cf3 ML-176.1: support search in collection api controller 2026-05-10 14:52:01 +01:00
Claudio Ortolina 0a9fafd35e Add micro_cover_url 2026-05-05 23:22:37 +01:00
Claudio Ortolina be76d0f214 Provide mini covers (150px) 2026-05-05 16:33:43 +01:00
Claudio Ortolina cccd28a9f9 ML-165: implementation 2026-05-05 13:43:18 +01:00
Claudio Ortolina 1ddef07bcc fix(api): handle non-integer error ids, clamp negative pagination params
- show/2: use case instead of bare Integer.parse match so
  /api/v1/errors/not-an-id returns 404 instead of crashing
- index/2: clamp limit to >= 1 and offset to >= 0 to prevent
  SQLite from treating negative values as unlimited
- Add 3 tests: non-integer id 404, negative limit/offset clamping
2026-05-04 14:17:45 +01:00
Claudio Ortolina 51bd24d5b4 ML-162: enable /api/v1/errors endpoint 2026-05-04 13:14:40 +01:00
Claudio Ortolina c489fde1cc ML-152: add /api/v1/ version prefix to all API routes 2026-04-30 11:57:43 +01:00
Claudio Ortolina 90db113845 ML-5: document Last.fm OAuth callback trust boundary
Closes GitHub issue #178.
2026-04-24 08:05:07 +01:00
Claudio Ortolina 92a36b915a Harden public asset endpoint against invalid payloads
Closes #143
2026-03-30 14:56:40 +01:00
Claudio Ortolina 45fd414f1b Use friendly error messages in Last.fm callback
Closes #145
2026-03-30 14:42:20 +01:00
Claudio Ortolina 47ca6fa1d2 Add canonical_tailwind to get correct formatting for tailwind classes 2026-03-20 13:02:32 +00:00
Claudio Ortolina 2e3732e38b Apply all necessary exclusions to sobelow findings 2026-03-07 18:37:24 +00:00
Claudio Ortolina c87f946479 Skip Sobelow Traversal.SendDownload warning for archive controller 2026-03-07 18:21:57 +00:00
Claudio Ortolina 27e5f68fbb Skip Sobelow XSS.ContentType warning for asset controller 2026-03-07 18:16:50 +00:00
Claudio Ortolina eb8a00ab54 Replace String.to_integer with safe Integer.parse
Use Integer.parse/1 instead of String.to_integer/1 on user-supplied
and external API input to prevent ArgumentError crashes on non-numeric
values. Adds fallback defaults or nil returns at each call site.
2026-03-05 14:27:37 +00:00
Claudio Ortolina 316c1bcfe3 Account for broken asset requests 2025-11-12 10:53:20 +00:00
Claudio Ortolina 4566744253 Remove unnecessary pattern matches 2025-10-28 09:25:02 +00:00
Claudio Ortolina 59eb603b3f Return more record information in the API 2025-10-25 11:52:50 +01:00
Claudio Ortolina 886f4815c8 Vacuum repo before returning backup file 2025-10-25 11:36:34 +01:00
Claudio Ortolina f02564fa30 Add /api/collection/on_this_day endpoint 2025-10-24 20:06:23 +01:00
Claudio Ortolina 90b3fa1fdc Refactor Records.Cover to Assets.Image 2025-09-20 07:42:38 +03:00
Claudio Ortolina c5d856fdd8 Add Transform.new/1 2025-09-19 23:58:09 +03:00
Claudio Ortolina 8807fce15b Don't assume webp accept is at the beginning 2025-09-18 21:45:40 +03:00
Claudio Ortolina 83151a125b Remove unused artist functionality 2025-09-18 21:26:26 +03:00
Claudio Ortolina e158345674 Change /covers to /assets 2025-09-18 21:26:16 +03:00
Claudio Ortolina 3428ad4537 Serve artist images from assets 2025-09-18 21:26:16 +03:00
Claudio Ortolina aa72692eaf Cache transformations 2025-09-17 16:54:47 +03:00
Claudio Ortolina b0f4e18ef7 Fix API collection record cover URLs 2025-09-17 11:24:14 +03:00
Claudio Ortolina 0996b78c7b Use Transforms to serve covers at the right size 2025-09-17 10:26:38 +03:00
Claudio Ortolina dc77d337c0 Migrate from embedded covers to assets 2025-09-01 16:20:41 +03:00
Claudio Ortolina bd12454884 Serve covers from assets 2025-09-01 14:44:17 +03:00
Claudio Ortolina 49c3a5cba2 Serve images from assets table 2025-09-01 13:46:32 +03:00
Claudio Ortolina 7869401445 Uniform shadow with rest of the app 2025-08-30 09:18:11 +03:00
Claudio Ortolina acd34424f7 Use LiveToast instead of built-in flash helpers
So that they can stack and get dismissed automatically
2025-07-16 15:26:30 +01:00
Claudio Ortolina 1f716e3c1f Use .button in login form 2025-05-12 17:16:24 +01:00
Claudio Ortolina f5bc8a640d Consolidate Fluxon usage via CoreComponents
With the exclusion of 'button' which is already in use an may need a
refactor
2025-05-12 10:43:13 +01:00
Claudio Ortolina fddc2dcbf0 Link Last.fm account from tracks 2025-05-07 11:26:41 +01:00
Claudio Ortolina 9aecd4cc94 Fix last_fm_session_key secret name 2025-05-07 09:03:47 +01:00
Claudio Ortolina 95f71519d3 Store Last.fm API key with encrypted secret 2025-05-06 15:18:14 +01:00
Claudio Ortolina d5b29b20bb Store last fm information into session (doesn't work yet) 2025-05-05 20:58:37 +01:00
Claudio Ortolina 7c547f2d80 Redirect to Last.fm and receive a token (unused) 2025-05-05 19:19:12 +01:00
Claudio Ortolina e173925a2a Use fluxon components for remaining inputs 2025-05-01 21:50:34 +01:00
Claudio Ortolina 3d3e758a7a Add endpoint to display an artist image 2025-04-27 21:20:38 +01:00