PromyLOPh / pandora-apidoc

pandora.com API documentation
https://6xq.net/pandora-apidoc/
Do What The F*ck You Want To Public License
48 stars 19 forks source link

Toggle Explicit Content Filter #15

Closed JasonLG1979 closed 8 years ago

JasonLG1979 commented 8 years ago

The Explicit Content Filter can be toggled with:

Method: user.setExplicitContentFilter

arg: isExplicitContentFilterEnabled : boolean

It returns nothing and has no effect if the Explicit Content Filter is PIN Protected. The state of the filter and PIN protection can ofc be checked with user.getSettings. It doesn't take effect until the next playlist.(i.e. any prior uncensored playlist does not magically become censored and vice-versa)

I added the feature to Pithos a while ago. https://github.com/pithos/pithos/commit/50aa53694e6267e9a995915201d540b645cf0bd9

I'd do a direct pull request for this but I barely know what I'm doing on git/github,lol!!!

PromyLOPh commented 8 years ago

The method I’m using with pianobar is already documented: https://6xq.net/pandora-apidoc/json/account/#user-changesettings

I'd do a direct pull request for this but I barely know what I'm doing on git/github,lol!!! Go ahead, you can’t break anything.

JasonLG1979 commented 8 years ago

user.changeSettings isExplicitContentFilterEnabled : boolean

causes a code 9 error

PromyLOPh commented 8 years ago

Interesting, it works for me. Did you include all the required parameters (pianobar code: https://github.com/PromyLOPh/pianobar/blob/master/src/libpiano/request.c#L407)?

JasonLG1979 commented 8 years ago

I was missing 'userInitiatedChange' (is that documented?) 'currentUsername' and 'currentPassword' Pithos doesn't user the user's password and username for anything but initial authentication from then on it uses the userAuthToken(we don't even storing it as an object in pandora.py, I had to modify the code slightly to get user.changeSettings isExplicitContentFilterEnabled to work) so it's more convenient for us to use user.setExplicitContentFilter isExplicitContentFilterEnabled : boolean.

PromyLOPh commented 8 years ago

I was missing 'userInitiatedChange' (is that documented?) 'currentUsername' and 'currentPassword' Yes, these are documented, userInitiatedChange is optional.

[…] so it's more convenient for us to use user.setExplicitContentFilter isExplicitContentFilterEnabled : boolean. I see.