Skip to content

Comments

fix: use request track count, better mix artist similar songs#9

Merged
NeptuneHub merged 1 commit intoNeptuneHub:mainfrom
ShimmerGlass:count-and-mix
Feb 22, 2026
Merged

fix: use request track count, better mix artist similar songs#9
NeptuneHub merged 1 commit intoNeptuneHub:mainfrom
ShimmerGlass:count-and-mix

Conversation

@ShimmerGlass
Copy link

@ShimmerGlass ShimmerGlass commented Feb 6, 2026

The plugin used a config value for the track count to return for GetSimilarSongsByTrack, and returned everything for GetSimilarSongsByArtist. This ignores the "count" parameter in the request, which indicates how many songs the player wants.

This change makes use of this parameter and removes the plugin config value to better match what navidrome expects, and have one less thing for users to configure / worry about.

For GetSimilarSongsByTrack we simply use the parameter from the query and keep the same logic.

For GetSimilarSongsByArtist, however, no limit was implemented. Before this change the plugin returned tracks in "clumps": a few tracks for artist1, a few tracks for artist2, etc. I changed the logic to instead alternate between the "base artist" (from the request) and related artists, stopping when we have the desired number of tracks. This IMHO better emulates the "radio" features of popular streaming services.

@ShimmerGlass
Copy link
Author

Hey @NeptuneHub what do you think of this change ? :)

Copy link
Owner

@NeptuneHub NeptuneHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi and thanks for your effort. I think that the community helps is the first best advantages of doing open source project so thanks for your contribution.

Going to the code, in some input configuration you introduce a divide by zero. Please fix it.

For the rest I agree that following the Navidrome parameter, when possible, is better than adding new one.

The plugin used a config value for the track count to return for
GetSimilarSongsByTrack, and returned everything for
GetSimilarSongsByArtist. This ignores the "count" parameter in the
request, which indicates how many songs the player wants.

This change makes use of this parameter and removes the plugin config
value to be better match what navidrome expects, and have one less thing
for users to configure / worry about.

For GetSimilarSongsByTrack we simply use the parameter from the query
and keep the same logic.

For GetSimilarSongsByArtist, however, no limit was implemented. Before
this change the plugin returned tracks in "clumps": a few tracks for
artist1, a few tracks for artist2, etc. I changed the logic to instead
alternate between the "base artist" (from the request) and related
artists, stopping when we have the desired number of tracks. This IMHO
better emulates the "radio" features of popular streaming services.
@NeptuneHub NeptuneHub merged commit f22b07f into NeptuneHub:main Feb 22, 2026
1 check passed
@NeptuneHub
Copy link
Owner

Merged and Thank you for your contribution.

@ShimmerGlass ShimmerGlass deleted the count-and-mix branch February 22, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants