Skip to content
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

Ratings support? #31

Closed
sardaukar opened this issue Jan 30, 2020 · 13 comments
Closed

Ratings support? #31

sardaukar opened this issue Jan 30, 2020 · 13 comments

Comments

@sardaukar
Copy link

Is implementing ratings per track a goal?

@sentriz
Copy link
Owner

sentriz commented Feb 7, 2020

yes I would hope to do this in the future. should not be too hard. just need some time

@davidhampgonsalves
Copy link

davidhampgonsalves commented Mar 19, 2020

@sentriz do you have ideas for how you plan on implementing this? I see that nicksellen/audiotags only supports read operations through taglib. Were you thinking of adding the ability to change ratings to that first?

If so it looks like https://github.com/NBonaparte/audiotags/commits/master might be a good starting point and if that is inline with your thinking I will probably take a pass at this.

@sentriz
Copy link
Owner

sentriz commented Mar 19, 2020

My idea was a track rating table instead of tags. With columns track_id, user_id, rating - to make sure ratings are per user. But I'd like to know what airsonic etc does

@davidhampgonsalves
Copy link

davidhampgonsalves commented Mar 19, 2020

Looks like that's what airsonic is doing as well:

https://github.com/airsonic/airsonic/blob/828c1b2674b1b5bf4f96454ed5c154a0c074f3bb/airsonic-main/src/main/java/org/airsonic/player/controller/SetRatingController.java

I need the audio files to be the source of truth so I'll do something different.
Thanks

@davidhampgonsalves
Copy link

Yes, sorry I was unclear, I meant that what you suggested is what airsonic does.

@sentriz
Copy link
Owner

sentriz commented Mar 19, 2020

ohh sorry yes. I misread :) if I did end up implementing ratings the way airsonic does. you could probably make a little script to update the gonic db's ratings for a given user and list of tracks

@davidhampgonsalves
Copy link

Yea I think I would do that. Also thanks for exposing gonicscan, really handy.

@sentriz
Copy link
Owner

sentriz commented Mar 22, 2020

also, looking at http://www.subsonic.org/pages/api.jsp "setRating"
this depends on #41
as pointed out: #41 (comment)
since the rating id can be a track, album, etc. and gonic uses primary keys for it's track, album, etc ids

@r0bbie
Copy link

r0bbie commented May 23, 2020

Would supporting favouriting / starring songs come under this, or be a separate feature request?

@sentriz
Copy link
Owner

sentriz commented Jun 6, 2020

just merged the ambig ids branch. this feature should now be possible. eg handler

func (c *Controller) ServeSetRating(r *http.Request) *spec.Response {
    params := r.Context().Value(CtxParams).(params.Params)
    id, err := params.GetID("id")
    // handle err
    switch id.Type {
    case specid.Artist:
        // rate artist
    case specid.Album:
        // rate album
    case specid.Track:
        // rate track
    }
}

hey @r0bbie they're not exactly the same of but very similar to implement (mostly copy paste >:))

@sentriz
Copy link
Owner

sentriz commented Nov 12, 2021

closing in favour of #171

@sentriz sentriz closed this as completed Nov 12, 2021
@sentriz
Copy link
Owner

sentriz commented Oct 26, 2022

ratings and stars are now shipped in master / :nightly . thanks to @brian-doherty

next release hopefully soon:
https://github.com/sentriz/gonic/milestone/1

sentriz pushed a commit that referenced this issue Oct 26, 2022
fixes #171
fixes #31

* Initial code. Compiles and passes unit tests.

* Moved average rating calculation from rating fetch to set rating function. Still only compiled and unit tested.

* Bug fixes

* Fixed bug in savePlayQueue. Removed unique_index for star / rating entries because it's not valid.

* Changed time format on stars to RFC3339Nano to match created date format.

* Lint fixes.

* More lint fixes.

* Removed add* functions and replaced with Preload.

* Fixed several bugs in handlers for getStarred and getStarred2.

* Fixed bug when using music folder ID.

Co-authored-by: Brian Doherty <brian@hplaptop.dohertyfamily.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants