1423 Commits

Author SHA1 Message Date
Claudio Ortolina e64f2b12c4 ML-200: switch to a vertical chart 2026-05-31 22:02:12 +03:00
Claudio Ortolina e67b172d64 ML-200: daily scrobble count charts 2026-05-31 21:52:06 +03:00
Claudio Ortolina 611ca7e386 Rename vertical_bar_chart -> horizontal_bar_chart 2026-05-31 21:13:53 +03:00
Claudio Ortolina 75e2ec5c70 ML-199: extract shared record show logic 2026-05-29 08:50:27 +03:00
Claudio Ortolina f4648ce5d9 Scrobble entire release from wishlist show page 2026-05-29 08:22:14 +03:00
Claudio Ortolina 33474c1472 Allow scrobbling wishlisted records 2026-05-29 08:09:55 +03:00
Claudio Ortolina dd24258f33 Make stats formats and types counters sync 2026-05-27 23:45:29 +03:00
Claudio Ortolina 87d2a59c3b Link included release groups to MusicBrainz
Render each included release group in the record detail page as a
link to its MusicBrainz release group page, opening in a new tab.
2026-05-27 13:00:45 +03:00
Claudio Ortolina 118171ed8a ML-169.8: restore formats/types stats position after counters
Formats and types stats should appear directly after the record counters,
before the TopArtists/TopAlbums/OnThisDay grid. The refactor had
accidentally moved them below.
2026-05-25 11:32:48 +03:00
Claudio Ortolina 2d8989a8d0 ML-169.8: keep latest record query synchronous
get_latest_record is a single fast ORDER BY LIMIT 1 query --
no reason to async-load it. Removes the <.async_result> wrapper
and the now-unnecessary render_async() from its test.
2026-05-25 09:42:14 +03:00
Claudio Ortolina f347f56218 ML-169.8: reduce Stats mount sync queries to 3
Move 7 non-critical queries out of synchronous mount into assign_async
and start_async tasks with skeleton loading placeholders.

Only scalar badge counters (collection count, wishlist count, scrobble
count) remain synchronous. All async sections use <.async_result> with
loading and failed slots. Scrobble activity preserves LiveView streams
via handle_async. On-this-day date changes use AsyncResult.ok/2.
2026-05-25 09:31:43 +03:00
Claudio Ortolina 6f5c959238 Show timezone settings in maintenance page 2026-05-25 09:16:56 +03:00
Claudio Ortolina b10be7ba3c ML-169.10: async delete actions with initial implementation 2026-05-22 16:19:54 +01:00
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 ff42f24972 ML-195: Add credo check for put_toast/put_toast! usage in live components 2026-05-21 08:08:11 +01:00
Claudio Ortolina 66fb688b2a Fix toasts not appearing for notes and barcode scan 2026-05-21 07:49:36 +01:00
Claudio Ortolina f1fde63d42 ML-189: simplify release-component notifications
- Use a tagged type
- Leave skipping responsibility to subscribed process
2026-05-19 12:18:07 +01:00
Claudio Ortolina 73046bb0f5 ML-190: fix record subscription lifecycle 2026-05-19 12:10:34 +01:00
Claudio Ortolina e204e555bd ML-188: guard PubSub record updates during edit mode
Add live_action guard to handle_info({:update, record}) in both
CollectionLive.Show and WishlistLive.Show. When the user is editing,
background worker updates are skipped and a warning toast is shown
instead of overwriting the socket. Normal show-mode updates and
mismatched-ID no-ops are unchanged.

6 tests added covering all three code paths.
2026-05-19 11:38:42 +01:00
Claudio Ortolina 3cba43236b Add format hint to record form release date 2026-05-18 16:25:49 +01:00
Claudio Ortolina 5212b8607e Reduce api medium cover size to 400px 2026-05-16 17:46:47 +01:00
Claudio Ortolina b6f429406f Use a button for the record status picker trigger 2026-05-16 15:11:21 +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 f108e6f062 ML-174: add empty action to record set dropdown menu
Add RecordSets.empty_record_set/1 that bulk-deletes all items in a set via
a single DELETE query and returns the reloaded empty set. Add Empty button
with confirmation prompt to both index and show view dropdowns.
2026-05-14 17:15:06 +01:00
Claudio Ortolina a59dd22a18 ML-168: broadcast index_changed event after background import
Import workers now broadcast :records_index_changed on
"records:index_changed" after successful import via
Records.broadcast_index_changed/0.

CollectionLive.Index and WishlistLive.Index subscribe to the
topic in mount/3 and reload their record streams on receipt,
with a live_action guard to skip reloads when the grid is
hidden behind a modal (:import, :barcode_scan).

IndexActions.handle_index_changed/1 refreshes total_entries
before reloading to keep the pagination bar accurate.
2026-05-14 17:15:06 +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 b557fe3eea Fix record picker search results clearing on add
The update/2 callback unconditionally reset the query and results to empty
on every parent re-render. Changed to assign_new/3 so search state persists
when the parent updates the record set after adding a record.
2026-05-09 20:11:51 +01:00
Claudio Ortolina ed6032bd15 Slow down shine animation, make it left to right only
Avoids dark edge at the bottom
2026-05-07 22:42:04 +01:00
Claudio Ortolina 621b35d824 Open universal search modal instantly via client-side JS
Replace phx-click server event with Fluxon.open_dialog for zero-latency
modal opening. The modal DOM is now always present (no :if conditional) so
it can be shown instantly; the server syncs state in the background.

Fix test selectors that now match the always-present modal form by scoping
to forms without phx-target (which the modal form always has).
2026-05-07 20:43:15 +01:00
Claudio Ortolina 10a24da49c Improve shine animations 2026-05-07 14:19:42 +01:00
Claudio Ortolina 5f240fe573 Fix stale PubSub subscriptions on record navigation
Subscription management was only done in mount/3, meaning
navigating to a different record via handle_params/3 left the
old subscription active. A background update for the old record
would then overwrite the currently displayed record.

Fix: manage subscriptions in handle_params/3 (unsubscribe old,
subscribe new) via shared RecordActions.manage_subscription/2,
and guard handle_info({:update,...}) against mismatched IDs.
2026-05-07 10:14:10 +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 db7e50d68b Move flash messages to the left
As the application makes heavy use of right-hand sheets, flash messages
are often lost.
2026-05-03 08:52:26 +01:00
Claudio Ortolina 3600bb204b Set explicit max_frame_size on websocket 2026-05-02 07:12:20 +01:00
Claudio Ortolina 450114100b Fix dimensions of camera button and preview 2026-05-01 22:09:44 +01:00
Claudio Ortolina c11009f3f9 Update dependencies
ex_slop 0.3.1 => 0.4.0
2026-05-01 17:03:14 +01:00
Claudio Ortolina 3849b338f3 Improve performance of job counting in maintenance
- Use a single query for all workers
- Replace the manual Ecto query against Oban.Job with Oban.Job.query/1
2026-04-30 14:54:56 +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 f8a52993c1 ML-149: Fix selected bar not showing track data in Safari 2026-04-30 07:21:25 +01:00
Claudio Ortolina f10a932aea Re-enable medium header + checkbox for releases with 1 medium 2026-04-27 11:47:32 +01:00
Claudio Ortolina 4418fbc377 Remove unnecessary specs
Function is private, and AsyncResult doesn't expose `t()`
2026-04-24 14:13:04 +01:00
Claudio Ortolina a1c665b490 ML-21: Classify API errors as transient vs permanent 2026-04-24 14:02:15 +01:00