[GH-ISSUE #433] Presence of albumArtist in tags does not always mean compilation #309

Closed
opened 2026-02-26 02:32:46 +03:00 by kerem · 6 comments
Owner

Originally created by @X-Ryl669 on GitHub (Sep 1, 2016).
Original GitHub issue: https://github.com/koel/koel/issues/433

For many songs I have, the albumartist tag is the same as artist, yet Koel thinks it's a compilation.
This line of code is the culprit:
File.php:176

        $props['compilation'] = (bool) (
            array_get($comments, 'part_of_a_compilation', [false])[0] || $props['albumartist']
        );

which, IMHO, should read:

        $props['compilation'] = (bool) (
            array_get($comments, 'part_of_a_compilation', [false])[0] || $props['albumartist'] !== $props['artist']
        );
Originally created by @X-Ryl669 on GitHub (Sep 1, 2016). Original GitHub issue: https://github.com/koel/koel/issues/433 For many songs I have, the `albumartist` tag is the same as `artist`, yet Koel thinks it's a compilation. This line of code is the culprit: File.php:176 ``` $props['compilation'] = (bool) ( array_get($comments, 'part_of_a_compilation', [false])[0] || $props['albumartist'] ); ``` which, IMHO, should read: ``` $props['compilation'] = (bool) ( array_get($comments, 'part_of_a_compilation', [false])[0] || $props['albumartist'] !== $props['artist'] ); ```
Author
Owner

@X-Ryl669 commented on GitHub (Sep 1, 2016):

Also, to be consistent, as soon as a song has a "compilation" set to true, then all songs in the album should be marked as a compilation (see my previous pull request for how I did it).

<!-- gh-comment-id:244089424 --> @X-Ryl669 commented on GitHub (Sep 1, 2016): Also, to be consistent, as soon as a song has a "compilation" set to true, then all songs in the album should be marked as a compilation (see my previous pull request for how I did it).
Author
Owner

@BernardGoldberger commented on GitHub (Sep 6, 2016):

@X-Ryl669 sren't there compilation albums where some of the song artists match the albumArtist?

<!-- gh-comment-id:244970425 --> @BernardGoldberger commented on GitHub (Sep 6, 2016): @X-Ryl669 sren't there compilation `albums` where some of the song `artists` match the `albumArtist`?
Author
Owner

@X-Ryl669 commented on GitHub (Sep 6, 2016):

@bdgold Yes. But I'm saying the opposite. As soon as there is an albums where the albumArtist is not artist then it's a compilation. Else, you can't say if it's a compilation (yet the current code thinks it is).

Said differently, the current code only inspect a single song to make a decision, so it makes errors from its assumption most of the time. In theory, it should inspect all songs from an album to figure out if it's a compilation (like a "if count(SELECT DISTINCT artist_id FROM songsForThisAlbum) > 1" => album is a compilation).

Hopefully, the current database model is cool, and as soon as you find a single song that could tell you it's a compilation, you mark the complete album as a compilation.

The corrected code above does exactly this, it does not take any decision until albumArtist is different than artist, and then, it marks the complete album as a compilation.

<!-- gh-comment-id:245009083 --> @X-Ryl669 commented on GitHub (Sep 6, 2016): @bdgold Yes. But I'm saying the opposite. As soon as there is an `albums` where the `albumArtist` is not `artist` then it's a compilation. Else, you can't say if it's a compilation (yet the current code thinks it is). Said differently, the current code only inspect a single song to make a decision, so it makes errors from its assumption most of the time. In theory, it should inspect all songs from an album to figure out if it's a compilation (like a "if count(SELECT DISTINCT artist_id FROM songsForThisAlbum) > 1" => album is a compilation). Hopefully, the current database model is cool, and as soon as you find a single song that could tell you it's a compilation, you mark the complete album as a compilation. The corrected code above does exactly this, it does not take any decision until `albumArtist` is different than `artist`, and then, it marks the complete album as a compilation.
Author
Owner

@BernardGoldberger commented on GitHub (Sep 6, 2016):

OK, I see, basically whenever there is a albumArtist present in a song Koel thinks its part of a compilation.

You are saying it should wait for a song in th album that has the albumArtist different than the contributing_artist.

Agreed.

Referencing https://github.com/phanan/koel/issues/403.

<!-- gh-comment-id:245012868 --> @BernardGoldberger commented on GitHub (Sep 6, 2016): OK, I see, basically whenever there is a `albumArtist` present in a song Koel thinks its part of a compilation. You are saying it should wait for a song in th album that has the `albumArtist` different than the `contributing_artist`. Agreed. Referencing https://github.com/phanan/koel/issues/403.
Author
Owner

@alex-phillips commented on GitHub (Nov 22, 2016):

+1. A lot of my songs has the band tag full, but it is, in most cases, the same as the artist itself. All of these are then flagged in the code as compilations incorrectly.

<!-- gh-comment-id:262254093 --> @alex-phillips commented on GitHub (Nov 22, 2016): +1. A lot of my songs has the `band` tag full, but it is, in most cases, the same as the artist itself. All of these are then flagged in the code as compilations incorrectly.
Author
Owner

@phanan commented on GitHub (Sep 23, 2022):

This should have been fixed in more recent versions.

<!-- gh-comment-id:1256043866 --> @phanan commented on GitHub (Sep 23, 2022): This should have been fixed in more recent versions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#309
No description provided.