Fix a track started directly never falling back to its album's artwork #24
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/track-image-albumid-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
One concrete, confirmed cause behind "the app struggles to find artist/album/track images."
imageUrlFor's ownAudio -> AlbumIdfallback (added earlier specifically because a track essentially never has its own Primary image, only its album usually does) was silently never triggering for a track played directly — not via its album or artist — because the raw item that decision runs against,CatalogService.getRawItem, never requestedAlbumIdfrom Emby. Emby's default field set for a single-item GET omits it entirely, soitem.AlbumIdreadundefinedregardless of whether the track's actual album genuinely had one — falling through to the track's own id every time.Every other path that resolves a track's image already asks for
AlbumIdcorrectly (getAlbumTracks/getPlaylistItemsRaw), which is why launching a whole album/artist/playlist was never affected. Fixed the one gap:getRawItemnow requestsFields=AlbumIdtoo — harmless for every non-Audio item it also fetches.Not the whole story, most likely — a real Emby library can also legitimately have no Primary image at all for a given artist/album (nothing to fall back to, not a bug). Flagged directly in docs/architecture.md rather than overclaiming "images are fixed" — worth a more specific follow-up report if artist/album art still struggles after this.
Test plan
npm run typecheck/npm test/npm run build(server) — clean, 148/148getRawItem's actual outgoing request includesFields=AlbumId(a mockedEmbyClient.fetchcapturing the real path/query, not just re-asserting the already-separately-testedimageUrlForlogic downstream of it)🤖 Generated with Claude Code