Desktop: album ownership badge says "in your library" for an album I hold 2 of 10 tracks of #16

Closed
opened 2026-08-18 05:54:00 +00:00 by logan · 2 comments
Collaborator

Report

I autotagged an album where I have 2 of 10 tracks. The album detail page shows a green tick and "Album [name] is in your library" instead of the expected "2 of 10 tracks ... are in your library". Inconsistency here is confusing — this needs to be accurate, consistent and communicative everywhere.

Findings

  • The partial badge state is only correct when the total is known: library-status-indicator documents that a caller with no total must pass in-library rather than a ring at 0%, because most of an untagged library would otherwise be marked incomplete on no evidence.
  • The total comes from audio_files.total_tracks, summed per disc by GetAlbumCompleteness, falling back to explore_index.total_tracks.
  • Our own tagwriter writes track and disc numbers but not totals — so autotagging a folder actively degrades the field this rests on. That matches the report exactly: the album became MBID-matched (green tick) while the completeness evidence stayed absent.

Direction

  1. Make tagwriter write TRACKTOTAL/DISCTOTAL (and the ID3 n/N form) when the matched release tells us.
  2. Make the catalog fallback cover this case — an MBID-matched album whose release group has a total_tracks should never fall back to the plain tick.
  3. Audit every badge call site for the same three-state confusion (owned / partial / unknown) so one rule produces all of them.

Related: the full-tracklist toggle issue and the "make unowned content obvious" issue.

**Report** I autotagged an album where I have 2 of 10 tracks. The album detail page shows a green tick and "Album [name] is in your library" instead of the expected "2 of 10 tracks ... are in your library". Inconsistency here is confusing — this needs to be accurate, consistent and communicative everywhere. **Findings** - The `partial` badge state is only correct when the total is *known*: `library-status-indicator` documents that a caller with no total must pass `in-library` rather than a ring at 0%, because most of an untagged library would otherwise be marked incomplete on no evidence. - The total comes from `audio_files.total_tracks`, summed per disc by `GetAlbumCompleteness`, falling back to `explore_index.total_tracks`. - **Our own `tagwriter` writes track and disc numbers but not totals** — so autotagging a folder actively degrades the field this rests on. That matches the report exactly: the album became MBID-matched (green tick) while the completeness evidence stayed absent. **Direction** 1. Make `tagwriter` write `TRACKTOTAL`/`DISCTOTAL` (and the ID3 `n/N` form) when the matched release tells us. 2. Make the catalog fallback cover this case — an MBID-matched album whose release group has a `total_tracks` should never fall back to the plain tick. 3. Audit every badge call site for the same three-state confusion (owned / partial / unknown) so one rule produces all of them. Related: the full-tracklist toggle issue and the "make unowned content obvious" issue.
logan self-assigned this 2026-08-18 22:10:15 +00:00
Author
Collaborator

Claiming this. Branch: fix/16-tagwriter-totals.

Approach

tagwriter writes track and disc numbers and drops the totals, so autotagging an album erases the very evidence GetAlbumCompleteness reads — which is the mechanism the report describes. Direction step 1:

  • MP3: TRCK / TPOS written as the n/N form, which is what dhowden/tag parses (parseXofN).
  • FLAC and OGG: TRACKTOTAL / DISCTOTAL, those exact names — dhowden/tag's Vorbis reader looks at tracktotal/disctotal and at nothing else (not TOTALTRACKS, and not an n/N inside TRACKNUMBER).
  • dbsync persists the total to audio_files.total_tracks, so the row agrees with the file without waiting for a rescan.

The total is per disc, because that is what GetAlbumCompleteness sums, so autotag derives it by counting the candidate's tracks on that track's own disc rather than using Candidate.TrackCount.

Steps 2 and 3 stay open under this: the catalog fallback (2) already landed as completenessAnswer() in explore-album-details, and the badge call-site audit (3) is the part that overlaps #38.

Claiming this. Branch: `fix/16-tagwriter-totals`. **Approach** `tagwriter` writes track and disc *numbers* and drops the totals, so autotagging an album erases the very evidence `GetAlbumCompleteness` reads — which is the mechanism the report describes. Direction step 1: - MP3: `TRCK` / `TPOS` written as the `n/N` form, which is what `dhowden/tag` parses (`parseXofN`). - FLAC and OGG: `TRACKTOTAL` / `DISCTOTAL`, those exact names — `dhowden/tag`'s Vorbis reader looks at `tracktotal`/`disctotal` and at nothing else (not `TOTALTRACKS`, and not an `n/N` inside `TRACKNUMBER`). - `dbsync` persists the total to `audio_files.total_tracks`, so the row agrees with the file without waiting for a rescan. The total is **per disc**, because that is what `GetAlbumCompleteness` sums, so autotag derives it by counting the candidate's tracks on that track's own disc rather than using `Candidate.TrackCount`. Steps 2 and 3 stay open under this: the catalog fallback (2) already landed as `completenessAnswer()` in `explore-album-details`, and the badge call-site audit (3) is the part that overlaps #38.
logan added the
Status
In Progress
label 2026-08-18 22:10:25 +00:00
Author
Collaborator

PR #105 is up and CI is green on both jobs (check and e2e, run 16966).

Step 1 is done and is what closes this. Steps 2 and 3 are not lost — the catalog fallback (2) had already landed as completenessAnswer() in explore-album-details, and the badge call-site audit (3) is #38's umbrella, which this unblocks.

One finding filed on the way: #104. The WAV case of the new round-trip test failed with every field zero, not just the totals — dhowden/tag has no RIFF reader, so nothing tagwriter puts in a WAV's id3 chunk is visible to metadata.ExtractTags. Pre-existing and invisible; wav_test.go verifies its writes by parsing that chunk itself, which is why no test ever noticed.

PR #105 is up and CI is green on both jobs (`check` and `e2e`, run 16966). Step 1 is done and is what closes this. Steps 2 and 3 are not lost — the catalog fallback (2) had already landed as `completenessAnswer()` in `explore-album-details`, and the badge call-site audit (3) is #38's umbrella, which this unblocks. One finding filed on the way: #104. The WAV case of the new round-trip test failed with *every* field zero, not just the totals — `dhowden/tag` has no RIFF reader, so nothing `tagwriter` puts in a WAV's `id3 ` chunk is visible to `metadata.ExtractTags`. Pre-existing and invisible; `wav_test.go` verifies its writes by parsing that chunk itself, which is why no test ever noticed.
logan closed this issue 2026-08-19 00:45:07 +00:00
gitea-actions bot removed the
Status
In Progress
label 2026-08-19 00:45:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: yonlu/yellowjacket#16