Commit Graph

1862 Commits

Author SHA1 Message Date
Claudio Ortolina c4ebe636ff Fix ML-143 review: security, worker, and test improvements
Closes ML-143 review findings:
- cast_id/1 uses Integer.parse instead of String.to_integer
- add_to_cart validates against server-side release_groups
- JS.push payload trimmed to {id, format} only
- Oban.insert_all result checked for partial failures
- handle_async success resets @importing? to false
- ImportFromMusicbrainzReleaseGroup gets unique constraint
- Record.parse_datetime/1 made public with safe match
- Workers delegate to Record.parse_datetime/1
- Test coverage: change_format, clear_cart, wishlist single import
2026-04-20 15:15:29 +01:00
Claudio Ortolina 3f5ce060b1 Implement ML-143: Cart-style multi record import
Closes ML-143.
2026-04-20 15:15:29 +01:00
Claudio Ortolina cf872cfed0 Secondary sort for artist albums in collection (purchase date desc) 2026-04-19 21:36:07 +01:00
Claudio Ortolina 7767933742 Give more space above the universal search input 2026-04-19 21:29:40 +01:00
Claudio Ortolina da12d5d693 Handle ArtistLive.Form saved message in show view 2026-04-19 08:59:04 +01:00
Claudio Ortolina 45236e4b10 Convert ErrorIgnorer tests to doctests 2026-04-19 07:50:39 +01:00
Claudio Ortolina fb1b60373d Fix max width issue for release selector on mobile 2026-04-18 10:57:14 +01:00
Claudio Ortolina f6bcf3d970 Partial fix for barcode scan camera persisting after disconnection 2026-04-18 10:50:41 +01:00
Claudio Ortolina b37162fce3 Fix colors of mixed badges 2026-04-17 22:30:27 +01:00
Claudio Ortolina 94143010c0 Fix doubly-wrapped safe tuple in artist bio render 2026-04-17 16:00:22 +01:00
Claudio Ortolina e6a8488137 Use Notes.change_note/2 instead of Note.changeset/2 in notes component
Closes #171
2026-04-17 12:56:08 +01:00
Claudio Ortolina bbe1722c9f Handle unencodable structs in QueryReporter params 2026-04-17 07:10:45 +01:00
Claudio Ortolina fbc548e903 Explicitly trust Wikipedia's HTML
Closes #168
2026-04-16 23:14:00 +01:00
Claudio Ortolina 464e627a63 Remove unnecessary padding from detail views 2026-04-16 22:54:39 +01:00
Claudio Ortolina 6b35b5cde5 Trigger search on Enter in search inputs inside forms 2026-04-16 15:15:47 +01:00
Claudio Ortolina 58c60193f2 Use pipe 2026-04-16 10:38:08 +01:00
Claudio Ortolina 840547c509 Speed up structured modal animation 2026-04-16 09:31:30 +01:00
Claudio Ortolina fea1231304 Replace refresh scrobble list icon
Makes it for a better animation
2026-04-15 22:52:28 +01:00
Claudio Ortolina 7899f621f3 Preserve rule picker state across parent re-renders 2026-04-15 15:11:17 +01:00
Claudio Ortolina 2124c982f7 Handle possible non-existent record id in search filter 2026-04-15 15:10:28 +01:00
Claudio Ortolina c816f2de4a Add scrobbled tracks search parser
Introduces ListeningStats.SearchParser with NimbleParsec supporting
record:, album_mbid:, artist_mbid:, artist:, album:, track: filters.
Links scrobble count on record page to filtered scrobbled tracks view.
2026-04-15 14:56:38 +01:00
Claudio Ortolina 851cb36858 Fix dl accessibility violations on stats dashboard 2026-04-15 14:16:24 +01:00
Claudio Ortolina 4194fb8b6d Update dependencies
oban_web 2.12.2 => 2.12.3
2026-04-15 13:50:52 +01:00
Claudio Ortolina 405235e2b3 Add picker to create scrobble rules on the fly 2026-04-15 10:53:58 +01:00
Claudio Ortolina b9612a2a26 Fix records on this day for partial release dates
SQLite interprets bare years (e.g. "1970") as Julian day numbers
in strftime, producing wrong month-day matches. Filter to only
full YYYY-MM-DD dates before comparing.
2026-04-15 07:29:58 +01:00
Claudio Ortolina ebd9e5445f Fix how long ago for records with year release dates 2026-04-15 07:20:01 +01:00
Claudio Ortolina d75508531e Generate parse_type/parse_format from module attributes 2026-04-14 16:56:04 +01:00
Claudio Ortolina 2bb755b1c8 Parse matching record fields in Records.Record 2026-04-14 16:51:06 +01:00
Claudio Ortolina 8db324d74a Extract shared badge/dropdown to ScrobbleComponents 2026-04-14 16:50:40 +01:00
Claudio Ortolina 888b5a68e6 Update all callers to use matching_records
Migrate StatsLive.Index, ScrobbledTracksLive.Index, and TopAlbums to
consume matching_records list instead of scalar record IDs. Remove the
derive_legacy_record_ids bridge function. TopAlbums now uses a dropdown
for multi-record badges with play count display.
2026-04-14 16:14:59 +01:00
Claudio Ortolina 9ef918a621 Update record_status_badges with matching_records and dropdown 2026-04-14 16:10:57 +01:00
Claudio Ortolina 2c6e6e7ca2 Return matching_records list from top_albums_attach_metadata
Apply the same release-group JSON aggregation pattern to top albums
queries. Add JSON parsing in get_top_albums/1 and
get_top_albums_by_days/2.
2026-04-14 16:05:51 +01:00
Claudio Ortolina cfd267627c Return matching_records list from tracks_with_record_info_query
Replace scalar collected_record_id/wishlisted_record_id subqueries with
a single matching_records JSON array grouped by release group
(records.musicbrainz_id). Add parse_matching_records/1 for JSON parsing
and derive_legacy_record_ids/2 as a temporary bridge for existing
templates. Update tests to use shared musicbrainz_id fixtures.
2026-04-14 14:17:02 +01:00
Claudio Ortolina 9f4135661e Replace scalar record IDs with matching_records JSON array in tracks query
Replaces collected_record_id and wishlisted_record_id correlated
subqueries in tracks_with_record_info_query with a single
matching_records json_group_array subquery that returns all records
sharing the same release ID. Adds parse_matching_records/1 for JSON
deserialization. Updates recent_activity/2 and list_tracks/1 to parse
the JSON at the boundary. Derives legacy collected_record_id and
wishlisted_record_id from matching_records so existing LiveViews keep
working. The get_top_albums test is temporarily skipped pending the
top_albums_attach_metadata update.
2026-04-14 14:12:14 +01:00
Claudio Ortolina e43bccb9bc Extract shared index logic into LiveHelpers.IndexActions
Closes #150
2026-04-13 23:09:22 +01:00
Claudio Ortolina 4fa13d5422 Reset chat state when navigating between entities
The Chat component kept stale messages and chat references
when patching to a different artist/record because update/2
only refreshed the chat list, not the active chat state.
2026-04-13 18:32:19 +01:00
Claudio Ortolina 6a6410bcaa Have the LLM use square bracketed links for internal references 2026-04-13 14:24:36 +01:00
Claudio Ortolina 96bb0fc403 Try and control ChatGPT's tone and "helpfulness" 2026-04-13 14:09:43 +01:00
Claudio Ortolina f7628267b3 Add @moduledoc to OpenAI.API 2026-04-13 13:15:43 +01:00
Claudio Ortolina bdc1cd3992 Prevent callback return value from halting stream
The delta branch in decode_responses_event now explicitly returns
:ok after invoking the callback, so a callback returning {:error, _}
cannot be mistaken for a stream-level error by decode_events.
2026-04-13 13:14:33 +01:00
Claudio Ortolina 6fa640f0f6 Remove unreachable catch clause in do_chat_stream 2026-04-13 13:12:58 +01:00
Claudio Ortolina 9b44b7050f Count unique catalog entries in collection summary
The record_count now reflects the number of grouped catalog lines
the model sees, not raw DB rows. Two copies of the same album on
different formats count as 1 catalog entry.
2026-04-13 13:12:30 +01:00
Claudio Ortolina 76438360d7 Load collection summary asynchronously on mount 2026-04-13 13:11:15 +01:00
Claudio Ortolina 5512ac0837 Hide button text on mobile 2026-04-13 12:53:57 +01:00
Claudio Ortolina 54dab5fbdf Use gpt 5.1 to cater for collection summary context size 2026-04-13 12:43:42 +01:00
Claudio Ortolina f9448cac6f Revert "Use smaller model so that we don't exhaust tokens"
This reverts commit 9c0e11bc84.
2026-04-13 12:34:17 +01:00
Claudio Ortolina 8108645718 Shrink collection summary to fit OpenAI token limit
Deduplicate records by musicbrainz_id (merging formats)
and cap genres to 3 per record, reducing the summary from
~32K to ~24K estimated tokens.
2026-04-13 12:33:15 +01:00
Claudio Ortolina 9c0e11bc84 Use smaller model so that we don't exhaust tokens 2026-04-13 12:06:24 +01:00
Claudio Ortolina f73be3f881 Handle OpenAI api streaming error messages 2026-04-13 11:54:05 +01:00
Claudio Ortolina 3b8415d8c4 Add Collection Chat to universal search 2026-04-13 10:15:43 +01:00