1. Purpose
MyRecordCollection is a personal register of LP and CD records. Each record has metadata, purchase details and a cover image stored locally. Records can be entered by hand, imported from a pasted purchase list, scanned from PDFs or images, or fetched from MusicBrainz and Discogs.
The app is made for a single user on their own computer. It has no login and only listens on localhost:5050 through Docker.
2. Architecture
Browser ──HTTP:5050──▶ Docker-container «myrecordcollection»
gunicorn (1 process, 8 threads ) + Flask
│ │
▼ ▼
data/records.db data/covers/
SQLite cover images (JPG/PNG/WebP)
│
one background thread per scan/lookup
├─▶ zxing-cpp barcodes, locally
├─▶ MusicBrainz releases, year, label (≤ 1 request/s)
├─▶ Cover Art Archive covers
├─▶ Discogs optional token
└─▶ Claude optional API key: fronts and spinesLong jobs (scanning many pages, MusicBrainz lookups) run in a background thread. The page polls the status every second and shows the progress. That is why gunicorn runs one process with several threads: the jobs live in the process memory.
3. Data model
The database is a single SQLite file, data/records.db, with two tables: records and settings (key/value for owner, keys and contact address). New columns are added automatically when a new version starts, so older databases are upgraded without loss.
Column in records | Content |
|---|---|
| Required |
|
|
| From MusicBrainz/Discogs or typed in |
| Condition (M, NM, VG+ …) and free text. Release and link are put in the notes |
| The purchase. Records with the same place and date make up one purchase |
| File name in |
| Timestamps |
There is no unique key on artist and title. The same record can appear several times, and the detail page gathers the copies.
4. Importing purchase lists
The import parses free text line by line. It is forgiving about dashes, spaces and price formats.
Platemesse 10.05.2025 (1.127,-)
Robbie Robertson - Robbie Robertson (1987) 100,-
Electric Light Orchestra - Time (1981) 100,-
Platemesse 30.08.2025 (1.300,-)
Peter Gabriel – So (1986) 200,-
Peter Gabriel – So (1986) 200,-A line with a date (
dd.mm.yyyy) starts a purchase. Text before the date becomes the place, and an amount in brackets becomes the total.A record is
Artist - Title (year) price. The separator can be-,–or—with spaces around. Year and price are optional.Prices such as
100,-,1.127,-,kr 150and99,50are understood.Duplicates are kept. The sum of the records is compared with the total for the purchase, and differences are shown in the preview.
If the same list is imported again, records with the same artist, title, purchase date and price are recognised and left unticked.
5. Scanning
PDF pages are rendered to images with
pypdfium2. iPhone images (HEIC) are read withpillow-heif.zxing-cppfinds every barcode on the page, several per page too. Only EAN-13, EAN-8 and UPC-A codes with a valid check digit are used.Each barcode is looked up in MusicBrainz. If MusicBrainz does not answer or does not know the code, Discogs is tried (with a token).
With an API key the page is also sent to Claude, which reads artist and title from fronts and spines. The hits are enriched from MusicBrainz.
The preview shows the page image next to the hits. The same record found several times is marked as a duplicate and left unticked.
Temporary files live in data/scan_tmp/ and are cleaned up automatically.
6. MusicBrainz and Discogs
The form accepts a link, an MBID, a barcode or a search. The result fills in the form fields, but nothing is saved until you press Save.
6.1. MusicBrainz
At most one request per second, and a
User-Agentwith the contact address from Settings, as MusicBrainz requires.503 responses are retried with an increasing pause. The error text from MusicBrainz is shown, and Test MusicBrainz under Settings checks the connection.
The original year comes from the release group. The cover comes from the Cover Art Archive.
6.2. Discogs
Links to
/release/and/master/work without a token. Extra parameters in the link are ignored.Vinyl is registered as LP. The original year comes from the master.
Covers and search require a free personal token from discogs.com (Settings → Developers).
7. Backup, moving and upgrading
A backup is a zip file with the database and all the covers. It can be downloaded, saved in data/backups/ or uploaded for restore. Before a restore an automatic safety copy of the current collection is made.
myrecordcollection-backup-2026-11-18_101500.zip
├── manifest.json app, format, time, number of records and covers
├── records.db consistent copy (SQLite backup API)
└── covers/ all the cover imagesscripts/pakk.sh --med-data makes a zip with the program and such a backup in migrering/backup.zip. If the app is running, the backup is fetched from it. If it is stopped, the database is copied with sqlite3 .backup. scripts/installer.sh restores it on the new computer and renames the file afterwards, so it is not offered again.
8. Language and theme
The pages are written in Norwegian. The English version is translated in the browser from a catalogue (static/i18n-en.js) with fixed texts and patterns where numbers are replaced by {n}. Elements that appear later on the page are translated too. The choice is stored in a cookie, so server messages also come in the right language.
Light and dark mode use CSS variables. The first visit follows the operating system setting.
9. HTTP interface
| Route | What it does |
|---|---|
| The collection. Parameters: |
| New record |
| Detail page, with every copy |
| Edit and delete |
| Paste list → preview → import ( |
| Starts a background scan and reports progress as JSON |
| Looks up a link, MBID or barcode (MusicBrainz or Discogs) |
| Search by artist and title, and a connection test |
| Owner, keys and contact address |
| Printable overview and CSV export |
| Backup and restore |
| The cover images |
10. Source code
| File | Content |
|---|---|
| The Flask app: routes, database, settings, backup and MusicBrainz lookups |
| Parses pasted lists |
| Scanning: PDF pages, barcodes, Claude and lookups |
| Discogs API: release, master, search and covers |
| The pages, the stylesheet and the language files ( |
| Installation and packaging |
|
|
Dependencies: Flask 3, gunicorn, Pillow, pypdfium2, zxing-cpp and pillow-heif.