ampache / python3-ampache

Python XML and JSON API library for Ampache
GNU General Public License v3.0
10 stars 5 forks source link

Cannot rate items #12

Closed SimonHova closed 2 years ago

SimonHova commented 2 years ago

I haven't had a chance to do some more serious troubleshooting on the Ampache side (like running any kind of debug logs), but when rating an item, rather than an HTML code, I just get a few blank lines, and the operation is unsuccessful. Can someone please validate this for me?

lachlan-00 commented 2 years ago

i have an error in v4 of the api calls on develop which i'll fix but i'm not getting issues with rating on 5 calls.

empty responses are probably a PHP error on the server though.

SimonHova commented 2 years ago

Appreciated! I will try and turn on debugging and repost the logs.

On Wed, Jan 26, 2022, 7:23 PM lachlan @.***> wrote:

i have an error in v4 of the api calls on develop which i'll fix but i'm not getting issues with rating on 5 calls.

empty responses are probably a PHP error on the server though.

— Reply to this email directly, view it on GitHub https://github.com/ampache/python3-ampache/issues/12#issuecomment-1022726286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGWV3XMA3LDQ2LPSPNTKU3UYCF6TANCNFSM5MVVZY4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

SimonHova commented 2 years ago

Okay, I dug a bit deeper; the problem isn't with the rating but with the search function. Specifically, it returns blank results whenever I try to search for a song by MBID. So, if I send the function something like:

amp_song = ampache.advanced_search(args.Amp_URL, Amp_key, [['mbid',4,'06d3bb88-98ce-437f-9a04-d1bb21462f21']], object_type='song')

amp_song[0].text will return 1 (which means it found one result), but it will return a blank element in amp_song[1], breaking my rate function. What's odd is that the same code works perfectly with artist and albums.

lachlan-00 commented 2 years ago

ah, good, i'll check tomorrow

lachlan-00 commented 2 years ago

I'm def able to find the songs using xml and json. Is the call not returning anything in a browser?

it sounds like a null result.

here are 3 responses for mbid (song/album/artist) and they all seem okay. this is api5 are you using 4?

artist.txt album.txt song.txt

SimonHova commented 2 years ago

It looks like it was a problem with me after all; I was trying to read the XML result as a text file and it was choking. I just modified my code and ran it through 500 songs and it rated them flawlessly. Though, I did think of an enhancement; I would prefer if it rated all the recordings with the MBID and not just the first one that it sees. I'll submit that one on the main ampache project later. Thanks again for your help!