User avatar
zag
Site Admin
Posts: 182
Joined: Tue Oct 11, 2016 9:43 am

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 8:22 am

robwebset wrote:Hi Zag,

Just doing the Album stuff and I'm not sure It's working as I'd expect.

If I call:

http://www.theaudiodb.com/api/v1/json/<REMOVED>/submit-album.php?user=robwebset&artist=Michelle+Shocked&album=Short+Sharp+Shocked&rating=8&api=<REMOVED>


I get a reply:

{"result":"SUCCESS Updated rating"}


However the item is not updated:
http://www.theaudiodb.com/album/2148164

Thanks
Rob


Yep another good spot, the logic was a bit off, simply because you had already rated a track with that album id so it was taking the wrong code path. Should be fixed now as I added a check for the track to be null. Tested and works.

User avatar
zag
Site Admin
Posts: 182
Joined: Tue Oct 11, 2016 9:43 am

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 8:30 am

robwebset wrote:OK, new version available:

<More recent one later in the thread>

This one adds v16 support for setting the ratings.

It also adds an option to remove the resync history - this will result with every track being checked again rather than just the changed tracks.

Thanks
Rob


I woke up a cold sweat about this last night :) Before I start testing, can I just check you know that ratings were out of 5 in previous versions? Therefore the ratings will need to be doubled. I can't quite remember which version they changed.

EDIT: Yep 1-10 music rating scale was introduced in Krypton:
https://github.com/xbmc/xbmc/commit/c5b ... cf2cc74ce1

User avatar
robwebset
Site Mod
Posts: 281
Joined: Fri Dec 02, 2016 12:39 pm

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 8:37 am

Yes - the ratings are scaled to be out of 10 :)

User avatar
zag
Site Admin
Posts: 182
Joined: Tue Oct 11, 2016 9:43 am

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 9:01 am

OK tested Krypton with 2 locally rated tracks and they were uploaded successfully! Log looks fine and the site has been updated as well.

Awesome!

http://www.theaudiodb.com/album/2272660

I rated both "Bumble" and "Sunday Smiled" tracks locally on Kodi and synced. This is wonderful :mrgreen:

Also tested incorrect API key and that didn't work (as expected) with a clear error.

And quick syncs showing the 5 minute warning, again working as expected.

EDIT: Maybe a help string, in the config TheAudioDB section about how to find the API token? I.E. "To find your API token, please visit TheAudioDB website, register for a username(if you haven't already). Login, go to the TADB homepage and click on your username in the top right hand corner. You will find your API key on the bottom left of the user profile page."

Also the do you think the terminology is correct when "updating" ratings to kodi. I think it probably should be called "downloaded" to match the "uploaded" dialogue box.

EDIT2: Also tested album uploads and its working fine

User avatar
zag
Site Admin
Posts: 182
Joined: Tue Oct 11, 2016 9:43 am

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 12:59 pm

A question from a user on the kodi forums:

http://forum.kodi.tv/showthread.php?tid ... pid2564208

Does this Add-on only effect the userrating field and leave the overall "rating" intact?

User avatar
robwebset
Site Mod
Posts: 281
Joined: Fri Dec 02, 2016 12:39 pm

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 1:14 pm

Hi Zag,

On v17 it should update both ratings.

Working on the clearing track rating (setting to zero) but it seems to leave things in a strange state - it correctly removed it from the track:

http://theaudiodb.com/track/33194857

But still leaves it on the album view:

http://theaudiodb.com/album/2148164

Thanks
Rob

User avatar
robwebset
Site Mod
Posts: 281
Joined: Fri Dec 02, 2016 12:39 pm

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 1:26 pm

Think I've found another one - setting albums to zero doesn't seem to work. Tried the following:

http://www.theaudiodb.com/api/v1/json/<REMOVED>/submit-album.php?user=robwebset&artist=Michelle+Shocked&album=Short+Sharp+Shocked&rating=0&api=<REMOVED>


And just get the response:
{"result":null}


And the rating doesn't change - it I set it to an actual value - then the update of the album appears to work OK.

Thanks
Rob

User avatar
robwebset
Site Mod
Posts: 281
Joined: Fri Dec 02, 2016 12:39 pm

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 2:01 pm

Hi Zag,

Another version:

<Published In uRepo>

This one:
- Allows the setting of a rating to Zero
- Changes the text for "downloaded ratings"
- Adds a brief description for Token API

If you are happy with this one - I'll push it to the repo tonight.

Thanks
Rob

User avatar
zag
Site Admin
Posts: 182
Joined: Tue Oct 11, 2016 9:43 am

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 2:06 pm

Cool yep right again, i've fixed the album code to now wipe the score.

Also fixed both track and album to recalculate the total score if the score is zero :)

Both should work again. Sorry about that.

User avatar
robwebset
Site Mod
Posts: 281
Joined: Fri Dec 02, 2016 12:39 pm

Re: [£20 Bounty] Push user ratings to TheAudioDB.com

Thu Apr 06, 2017 2:19 pm

Thanks Zag,

Seems to work OK now

Rob

Return to “Bounties”