fix(art): take track ID from match info instead of item mb_trackid#39
Merged
Conversation
The import_task_files art hook read the Beatport track ID from items[0].mb_trackid. Other plugins can blank that field on the shared in-memory Item before the hook runs — notably zero with mb_trackid in its fields and update_database: true, whose write listener sets item[field] = None during the import write phase. The hook then requested '/v4/catalog/tracks//', got a 404 and skipped art embedding. Source the ID from task.match.info instead: first track with an ID for AlbumInfo matches, track_id for singleton TrackInfo matches, and skip with a debug log when the match carries no ID. Fixes #38
Samik081
force-pushed
the
fix/art-track-id-from-match
branch
from
July 9, 2026 21:29
f989df7 to
34c7ad8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #38 — album art was not embedded and the import log showed:
Root cause
The
import_task_filesart hook read the Beatport track ID fromitems[0].get("mb_trackid"). Other plugins can blank that field on the shared in-memoryItemobjects before the hook runs — notablyzeroconfigured withmb_trackidin its fields andupdate_database: true, whosewritelistener setsitem[field] = Noneduring the import write phase. The hook then requested/v4/catalog/tracks//(empty ID), got a 404, and skipped art embedding. Reproduced exactly withzero+scrubenabled on both fresh imports and-Lre-imports.Fix
Take the track ID from
task.match.info— data the plugin itself produced — instead of the mutable library item:AlbumInfomatches: first track with atrack_id(all tracks on a release share the same cover art)TrackInfomatches:info.track_idTesting
mb_trackid, singleton path, match without track IDs); full suite passes 140/140BEETSDIRwithzero(mb_trackidzeroed,update_database: true) +scrubenabled: re-import of the reporter's release (4194963) fetches and embeds art in all 4 files; singleton import path verified as well