Kodi Music Processing Phase 3: Common Album Artist

Topics · Published 2019-11-19 · Revised 2026-11-23
Reviewed corrections applied locally; pre-review version preserved separately · Joomla source

2,672 Total views across this article’s versions; includes the historical baseline where available.

This article is Part 3 of a 10-part series exploring the Kodi multi-media player's music file scanning and metadata scraping processes via logic flow diagrams.

Identifying Common Album Artist (Compilations Part 2)

This historical explanation is checked against Kodi 18.5 (Leia), commit 37f51f6e63cb. The pinned MusicInfoScanner.cpp source is the reference for the branches below. The original research checkout was not recorded; this pin identifies the version checked for this revision.

After Phase 2, FileItemsToAlbums() processes each primary-artist group in the album-name fallback path. This step is not a second pass that removes a compilation flag merely because the songs share an artist. The flag computed earlier is copied to the resulting album.

For each song, Kodi takes the album-artist list, or its song-artist list when the album-artist list is empty. It starts with the first song’s list and compares the others in order, retaining only the common leading sequence. Comparison here is case-sensitive and position-sensitive. Finding a name somewhere in every list is not enough; this is neither a set intersection nor duplicate-name removal.

Lists within one primary-artist groupCommon leading sequence
[A, B] and [A, C][A]
[A, B] and [A, B, C][A, B]
[A, B, C] and [A, C, B][A]
[A, B] and [A, b][A]

The next block uses this sequence for the album’s artist credits and fills it into songs whose album-artist lists are missing. Existing nonempty song album-artist lists are retained. This does not identify an unknown performer or rewrite the audio-file tags. The first available album-artist sort value is handled separately; individual sort names are applied only when their count matches the artist-credit count.

The source is FileItemsToAlbums(), lines 744–819, in the pinned scanner. The original diagram incorrectly labels this block FindArtForAlbums and simplifies full ordered-list comparison to a first-name/deduplication operation. It remains available as historical material; the table and explanation above describe the checked implementation.

Next up is Phase 4: Default Album Artwork.