[API] MusicArtists have incorrect childCount and 'null' songCount #7030

Open
opened 2025-12-22 05:08:41 +01:00 by backuprepo · 2 comments
Owner

Originally created by @lukaslindnermusic on GitHub (May 21, 2025).

Description of the bug

During work on the Finamp Redesign (proper differentiation between album artists and ("performing") artists), we wanted to include the Album Count of Album Artists and the Track/Song Count of (Performing) Artists in the list.

We noticed, that there are inconsistencies in the counts:

  1. The albumCount - which I personally thought would be the value to use - seems to always be null.

  2. The childCount seems to be the count of albums of an (album)artist. However, I noticed some incorrect counts:

  • I first noticed, that albums that have not a single but MULTIPLE album artists assigned, don't increase the count for these artists. So if you're an album artist and only have an album where you've worked together with other artists, your count will be 0 (or null). Obviously, I think it ideally should loop through albumArtistIds and increase the counter for everyone.
  • In addition to that, I noticed just now that some artists also have incorrect counts even when they have only single-album-artist albums. In my case, I noticed this for "AC/DC". I first suspected, that the reason could be that in the audiofile metadata-tags, I've set an artist but not albumArtist tag. And indeed, that was the case. In that case, Jellyfin displays all artists of an album as album artists as well. However, I thought, maybe this for some reason does not apply to the counts. So I edited the files and added albumartist tags, and then refreshed the metadata with the checkmark at "Replace all metadata". However, the problem still persists and there is a 'null' childCount, but there definitely are 3 albums that have the artist assigned as single albumartist and in every list etc., everything shows up correctly. So, I thought, maybe its because of the "/" inside of the artist name - but I also have this with artists that have no special characters whatsoever and are also correctly set as albumartist in the file metadata.
  1. The songCount is null as well. It would be really nice if it would include the track count, where the artist was assigned in the "artist"-tag directly to a track (so, Appears On tracks as well as tracks where the artist is albumArtist + "performing" artist).

Providing the correct counts would make life for clients so much easier, as I think the only option to currently accurately display the counts is to run two additional queries for each artist (one for the album children and one for the track/song children) and then grab the totalRecordCount from those... this is possible when you're about to display an individual artists profile, but it is a huge and just unecessary overhead when you're putting together a list of all your artists.

Thanks for your help 😊

Reproduction steps

  1. Add albums with multiple album artists.
  2. Review the value for childCount returned from the api.

The other problem (where there is only a single album artist) I could not pinpoint, so I can't provide exact reproduction steps.

What is the current bug behavior?

the API returns incorrect childCounts for some MusicArtists.
As mentioned above, this seems to be related to when there are multiple album artists for an album - in this case, the counts of these artists don't increase.
In addition to that, there seem to be other but more rare scenarios where even counts of single album-artist albums don't increase.

What is the expected correct behavior?

Most importantly, the correct album childCount should get returned.

Ideally, songChount should also return the number of tracks where the artist is assigned as artist.
Optionally, the childCount could get moved to albumCount in that case, as it then specifies better what the count actually reflects.

(Side Node: This could also be good for Genres 😊 )

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.10.7

Environment

- OS: Synology DSM 7.2.2-72806 Update 3
- Linux Kernel: /
- Virtualization: Docker ("Container Manager")
- Clients: *
- Browser: *
- FFmpeg Version: the one included in the docker image
- Playback Method: /
- Hardware Acceleration: no
- GPU Model: /
- Plugins: Playback Reporting, more that are unrelated to music...
- Reverse Proxy: Synologies built-in one, I think its based on nginx(?)
- Base URL: /
- Networking: host
- Storage: local

Jellyfin logs

/

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @lukaslindnermusic on GitHub (May 21, 2025). ### Description of the bug During work on the Finamp Redesign (proper differentiation between album artists and ("performing") artists), we wanted to include the Album Count of Album Artists and the Track/Song Count of (Performing) Artists in the list. We noticed, that there are inconsistencies in the counts: 1. The `albumCount` - which I personally thought would be the value to use - seems to always be `null`. 2. The `childCount` seems to be the count of albums of an (album)artist. However, I noticed some incorrect counts: - I first noticed, that albums that have not a single but MULTIPLE album artists assigned, don't increase the count for these artists. So if you're an album artist and only have an album where you've worked together with other artists, your count will be 0 (or null). Obviously, I think it ideally should loop through `albumArtistIds` and increase the counter for everyone. - In addition to that, I noticed just now that some artists also have incorrect counts even when they have only single-album-artist albums. In my case, I noticed this for "AC/DC". I first suspected, that the reason could be that in the audiofile metadata-tags, I've set an artist but not albumArtist tag. And indeed, that was the case. In that case, Jellyfin displays all artists of an album as album artists as well. However, I thought, maybe this for some reason does not apply to the counts. So I edited the files and added albumartist tags, and then refreshed the metadata with the checkmark at "Replace all metadata". However, the problem still persists and there is a 'null' childCount, but there definitely are 3 albums that have the artist assigned as single albumartist and in every list etc., everything shows up correctly. So, I thought, maybe its because of the "/" inside of the artist name - but I also have this with artists that have no special characters whatsoever and are also correctly set as albumartist in the file metadata. 3. The `songCount` is `null` as well. It would be really nice if it would include the track count, where the artist was assigned in the "artist"-tag directly to a track (so, Appears On tracks as well as tracks where the artist is albumArtist + "performing" artist). Providing the correct counts would make life for clients so much easier, as I think the only option to currently accurately display the counts is to run two additional queries for each artist (one for the album children and one for the track/song children) and then grab the `totalRecordCount` from those... this is possible when you're about to display an individual artists profile, but it is a huge and just unecessary overhead when you're putting together a list of all your artists. Thanks for your help 😊 ### Reproduction steps 1. Add albums with multiple album artists. 2. Review the value for `childCount` returned from the api. The other problem (where there is only a single album artist) I could not pinpoint, so I can't provide exact reproduction steps. ### What is the current _bug_ behavior? the API returns incorrect childCounts for some MusicArtists. As mentioned above, this seems to be related to when there are multiple album artists for an album - in this case, the counts of these artists don't increase. In addition to that, there seem to be other but more rare scenarios where even counts of single album-artist albums don't increase. ### What is the expected _correct_ behavior? Most importantly, the correct album `childCount` should get returned. Ideally, `songChount` should also return the number of tracks where the artist is assigned as `artist`. Optionally, the `childCount` could get moved to `albumCount` in that case, as it then specifies better what the count actually reflects. (Side Node: This could also be good for Genres 😊 ) ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.10.7 ### Environment ```markdown - OS: Synology DSM 7.2.2-72806 Update 3 - Linux Kernel: / - Virtualization: Docker ("Container Manager") - Clients: * - Browser: * - FFmpeg Version: the one included in the docker image - Playback Method: / - Hardware Acceleration: no - GPU Model: / - Plugins: Playback Reporting, more that are unrelated to music... - Reverse Proxy: Synologies built-in one, I think its based on nginx(?) - Base URL: / - Networking: host - Storage: local ``` ### Jellyfin logs ```shell / ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
backuprepo added the
bug
label 2025-12-22 05:08:41 +01:00
Author
Owner

@jellyfin-bot commented on GitHub (Sep 19, 2025):

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

@jellyfin-bot commented on GitHub (Sep 19, 2025): This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs. If you have any questions you can use one of several ways to [contact us](https://jellyfin.org/contact).
Author
Owner

@lukaslindnermusic commented on GitHub (Sep 19, 2025):

no, this is not stale!

(god, I hate stale-bots 🙈😅)

@lukaslindnermusic commented on GitHub (Sep 19, 2025): no, this is not stale! (god, I hate stale-bots 🙈😅)
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/jellyfin#7030
No description provided.