New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(album_repository.go): add kodi-style album playcount option - #1032 #2803
feat(album_repository.go): add kodi-style album playcount option - #1032 #2803
Conversation
I would recommend a more proper descriptive name for the "kodi" mode such as "normalized" |
Thanks for this. I agree with @dweymouth, we should make the name more descriptive and also not reference the competitor ;) I'll review it soon, and give you feedback on this. |
Signed-off-by: Victor van der Veen <vvdveen@gmail.com>
Just found the time to make those changes and fix formatting. I see my branch is out-of-date with the base branch though. Let me know if I must merge and try again. |
Download the artifacts for this pull request: |
Yes, this documentation should go to https://www.navidrome.org/docs/usage/configuration-options/#advanced-configuration |
Signed-off-by: Victor van der Veen <vvdveen@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just fixed some small nitpicks.
Can you please add the new AlbumPlayCountMode
config option to the website?
Thanks for the contribution!
Closes #1032 * feat(album_repository.go): add kodi-style album playcount option - #1032 Signed-off-by: Victor van der Veen <vvdveen@gmail.com> * fix format issue and remove reference to kodi (now normalized) Signed-off-by: Victor van der Veen <vvdveen@gmail.com> * reduced complexity but added rounding Signed-off-by: Victor van der Veen <vvdveen@gmail.com> * Use constants for AlbumPlayCountMode values --------- Signed-off-by: Victor van der Veen <vvdveen@gmail.com> Co-authored-by: Deluan <deluan@navidrome.org>
Closes 1032.
Description
Adds a new configuration option
AlbumPlaycountMode
. When set to "kodi", album play count will be computed by dividing the total number of plays of all tracks on the album by the number of tracks. This is further discussed in2711.
I decided to make this option a string, to allow for other approaches / algorithms / modes to be added in the future.
Changes
AlbumPlaycountMode
to conf/configuration.go and cmd/root.go. Default value is"absolute"
meaning album playcount will be the sum of all individual track counts (current behavior).dbAlbum
to a model, any installed hooks will be invoked on the album.AlbumPlaycountMode = "kodi"
, a hook will be installed that will update the playcount according the discussion and issue above.