Skip to content

Show an upload's format from the server, as a coloured file icon - #691

Merged
thcp merged 1 commit into
mainfrom
fix/source-format-678
Sep 23, 2026
Merged

thcp merged 1 commit into
mainfrom
fix/source-format-678

Conversation

@thcp

@thcp thcp commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #690

The format icon from #678 read an upload's format out of source_url. For a real upload that is local:<title>, and the title has its extension removed, so the icon never appeared. It passed its tests because the fixture used local:e2e-fixture.wav, a shape no upload produces.

What changes

  • The server records source_format on upload and on re-split, from the extension the file was validated against.
  • Uploads made before this fill it in from their kept source.<ext> the first time their state is served. Uploads finished before sources were kept have nothing to find and keep the note.
  • The client takes it from job state, and backfills tracks already in the library at startup, so every row shows its icon without being opened.
  • The icon is a file with the format on a band, one colour per format (WAV gold, FLAC coral, MP3 blue, M4A teal, OGG violet, OPUS cyan, MP4 pink). It replaces the text label, and is shared by the library row and the now-playing square.
  • The quality label ("Lossless (WAV)", "Compressed (MP3)") read the same missing suffix and now uses source_format.
  • A re-split's marker now goes on the end of the source instead of before the last dot. Titles have no extension, so the dot it found was in the title: "Mr. Brightside" became "Mr (abc123). Brightside".

Tests

  • The e2e fixture now has the real shape (local:e2e-fixture) and a kept source.wav, so the backfill path runs end to end.
  • format-icon.spec.mjs replaces thumb-ext.spec.mjs: the row, the now-playing square, the startup backfill, a distinct colour per format, and which tracks get an icon.
  • pytest covers recording on upload, the backfill, no format for a link, and the re-split marker.

Checked against a local server with an existing library: uploads made before this change report source_format: wav from their kept source.

An upload's source_url is "local:<title>", and the title has its extension
removed, so the format icon from #678 read nothing and never appeared for a
real file. It passed its tests against "local:e2e-fixture.wav", a shape no
upload produces.

The server now records source_format on upload and re-split, and fills it in
for older uploads from the kept source.<ext>. The client takes it from job
state, and backfills tracks already in the library at startup.

The icon is a file with the format on a band, one colour per format. The
quality label ("Lossless (WAV)") read the same missing suffix and now uses
source_format too. A re-split's marker goes on the end of the source instead
of before the last dot, which split titles like "Mr. Brightside".

The e2e fixture now has the real shape and a kept source.wav.

Closes #690
@thcp
thcp merged commit 9345676 into main Sep 23, 2026
12 checks passed
@thcp
thcp deleted the fix/source-format-678 branch October 5, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An upload's file format is read from its title, which never has an extension

1 participant