Running ExUnit with seed: 849711, max_cases: 4
........................................................................................................................................................................................................................................................................................................................................................................................................................................................
1) test count_record_sets/0 and count_record_sets/1 returns total count (MusicLibrary.RecordSetsTest)
Error: test/music_library/record_sets_test.exs:97
** (Exqlite.Error) Database busy
INSERT INTO "record_sets" ("name","description","inserted_at","updated_at","id") VALUES (?1,?2,?3,?4,?5)
code: record_set(%{name: "One"})
stacktrace:
(ecto_sql 3.13.5) lib/ecto/adapters/sql.ex:1113: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto 3.13.5) lib/ecto/repo/schema.ex:1000: Ecto.Repo.Schema.apply/4
(ecto 3.13.5) lib/ecto/repo/schema.ex:500: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
(music_library 0.1.0) lib/music_library/record_sets.ex:71: MusicLibrary.RecordSets.create_record_set/1
(music_library 0.1.0) test/support/fixtures/music_library/record_sets.ex:16: MusicLibrary.Fixtures.RecordSets.record_set/1
test/music_library/record_sets_test.exs💯 (test)
................................................................................................................................
Finished in 25.5 seconds (3.4s async, 22.1s sync)
37 doctests, 532 tests, 1 failure
Music Library
- Music Library
Features
- Add records from MusicBrainz, with optional override of specific pieces of data
- Manage a collection and a wishlist of records, with ways to quickly search and filter based on records' metadata
- Integration with Last.fm:
- display latest scrobbles, and where possible connect them with records in the collection or wishlist
- scrobble a record
- store a local copy of the complete scrobble history, and setup rules to fix its data as needed
- audit scrobble data quality and identify tracks with missing MusicBrainz IDs
- Some basic stats
- All data stored in a single SQLite database for portability and ease of backup/restore
Screenshots
Stats
Collection
Searching for a record to add
Edit a record in the collection
View a record's details in the collection
View a record's tracklist
Adding a record in the wishlist
View an artist's details
View the scrobble activity
Setup
The project is managed and configured via mise-en-place:
mise installwill pull the correct Erlang, Elixir and Node.js versionsmise run dev:setupwill setup dependencies and database structure
Important
The project uses Fluxon UI, so it requires a valid set of credentials. See the
envsection inmise.tomlfor the required environment variables.
It's recommended to use the git hooks included in the project. Install with:
mise generate git-pre-commit --write --task=dev:precommit
Environment configuration
Required environment variables for development are listed in mise.toml.
You can create a mise.local.toml with the required variables (sample values
are included at the top of mise.toml).
For production, please see compose.yaml for a list of required variables.
Running the application
Start the Phoenix endpoint with mise run console (along with an attached IEx session).
Now you can visit localhost:4000 from your browser.
The default password for development is change me.
Auditing Scrobble Data Quality
The application includes a Mix task to audit scrobbled tracks and identify data quality issues such as missing MusicBrainz IDs for artists and albums.
Running the Audit
# Audit all tracks
mix scrobble.audit
# Audit with detailed output including sample tracks
mix scrobble.audit --verbose
# Audit only artist issues
mix scrobble.audit --type artist
# Audit only album issues
mix scrobble.audit --type album
# Output as JSON for processing
mix scrobble.audit --format json
Understanding the Audit Report
The audit report shows:
- Total number of scrobbled tracks
- Artists with missing MusicBrainz IDs (grouped by artist name)
- Albums with missing MusicBrainz IDs (grouped by album title and artist)
- Track counts for each issue
Fixing Data Quality Issues
After identifying issues, you can:
-
Create Scrobble Rules: Navigate to the Scrobble Rules page in the web interface and add rules to map artist or album names to their correct MusicBrainz IDs.
-
Apply Rules: Use the "Apply Rules" button in the Scrobble Rules page to update existing tracks, or run in IEx:
MusicLibrary.ScrobbleRules.apply_all_rules() -
Re-audit: Run the audit again to verify the fixes worked.
The application also provides helper functions in the MusicLibrary.ScrobbleActivity context:
count_tracks_missing_artist_musicbrainz_id/0count_tracks_missing_album_musicbrainz_id/0get_artists_missing_musicbrainz_id/1get_albums_missing_musicbrainz_id/1
Deployment
The application is deployed via Coolify, using a Docker Compose strategy.
CI
See the .github folder.
Architecture
See the docs folder.
Favicons
This favicon was generated using the following graphics from Twitter Twemoji:
- Graphics Title: 1f4bd.svg
- Graphics Author: Copyright 2020 Twitter, Inc and other contributors (https://github.com/twitter/twemoji)
- Graphics Source: https://github.com/twitter/twemoji/blob/master/assets/svg/1f4bd.svg
- Graphics License: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)








