AzuraCast / AzuraCast

A self-hosted web radio management suite, including turnkey installer tools for the full radio software stack and a modern, easy-to-use web app to manage your stations.
https://www.azuracast.com/
GNU Affero General Public License v3.0
3.08k stars 569 forks source link

api/nowplaying return empty array without athorization #5352

Closed vneznaikin closed 2 years ago

vneznaikin commented 2 years ago

Installation Method

Docker Installation

AzuraCast Release Channel

Rolling Release Channel

Current AzuraCast Version

Rolling Release #c4deb40 (2022-05-04 10:30)

What happened?

If I log in api work correct, but after log out api/nowplaying return empty array api/nowplaying/{station_id} work correct

in AzuraCast v0.13.0 Stable - work without problem


By the way: also maybe swagger is broken in last rolling realise api/nowplaying/{station_id} asks for an object instead of ID or Name how it was before. but {"stationed_id":1} not working and why is the lock icons always unlocked? I don't understand this logic. When I add API key, icons goes to loked. after page refresh it's again unlocked... Bug or work as designed?

Relevant log output

No response

Sakretsos commented 2 years ago

Hello @vneznaikin, try to use Postman for the API calls.

vneznaikin commented 2 years ago

@Sakretsos I didn't understand. Why do you need Postman? How will this fix the bug?

Vaalyn commented 2 years ago

This sounds like your station/s have the Enable Public Pages option disabled in the Edit Station Profile -> Profile page which will hide the station from the /api/nowplaying result for non-authorized users (i.e. via public access).

vneznaikin commented 2 years ago

@Vaalyn yes. I use my own player. How can I access this API node through my player? Can you provide an example or link to documentation? Thx

vneznaikin commented 2 years ago

If the only way is to enable public pages, give me a reason why it should work that way. Maybe we should separate public pages logic and API logic? Some additional checkbox in the Station Profile settings for example...

ItsMitchh commented 2 years ago

As Vaalyn mentioned, due to you not having your public page enabled, the API will not provide data for non-authorised users. If you believe this should be changed then we welcome pull requests! Or you can propose a change on our suggestion page https://features.azuracast.com/

Access to our API can be done through our PHP API Client, or through your AzuraCast's instance URL, such as example.com/api

Going to close this as it's not a bug.

vneznaikin commented 2 years ago

@SC2Mitch thx for the conversation. I'll think of a better way