klnusbaum / UDJ-Server

The Social Music Player!
www.udjplayer.com
GNU General Public License v2.0
43 stars 17 forks source link

[Feature Request] Admin Indicator when Joining Player #61

Closed jtfairbank closed 11 years ago

jtfairbank commented 11 years ago

It would be useful to return an indication if the user is an admin when they join a player. Currently, we'd have to compare the existing user with a list of admins on the server (see [GET] /udj/0_6/players/player_id/admins) after they join.

Also, how would you suggest we go about telling the user which players they are admins on when showing them the Player Select page? Currently, I think the only way to do this is to query every server in the current player search (by name or location) after we get that list. That being said, sending the admin info every time could create unnecessary overhead. Maybe send a list of servers and get back a dictionary of admins? That would solve both issues.

jtfairbank commented 11 years ago

See [PUT] /udj/0_6/players/player_id/users/user and [GET] /udj/0_6/players/player_id/admins for relevant API calls.

klnusbaum commented 11 years ago

@jtfairbank Player JSON objects (which I'm assuming you'll have when before you're joining the player) contain a list of admin users. I thought about this very issue :)

jtfairbank commented 11 years ago

Ah thanks, I missed that. Maybe update the documentation for [PUT] /udj/0_6/players/player_id/users/user so that it says a Player object is returned on a successful request?

klnusbaum commented 11 years ago

No no. You misunderstood. That call doesn't return information about the player. What I'm assuming is you've already done some sort of player search before hand (be it by location or name) where you have the JSON object of the player that you're trying to join already.

jtfairbank commented 11 years ago

Ah, I see. Yes, that setup works perfectly for what I need to do.