ramsayleung / rspotify

Spotify Web API SDK implemented on Rust
MIT License
632 stars 121 forks source link

Update the examples #479

Open brayo-pip opened 4 months ago

brayo-pip commented 4 months ago

So many of the examples provided are broken now. Please update, there are so many breaking changes that are not addressed.

masakk1 commented 2 months ago

I second this. I'm trying to use the pagination_sync example and it's broken.

MaximoMachado commented 2 months ago

What is the error you're encountering with pagination_sync? I ran it myself locally and it worked as expected. Give this command a try: cargo run --example pagination_sync --features="env-file cli client-ureq ureq-rustls-tls" --no-default-features

Also can you give a list of the other examples you're finding are broken?

Jonsen94 commented 1 month ago

Just tested "auth_code".

It uses the wrong scope. "user-read-currently-playing" would be correct and works fine.

ramsayleung commented 1 month ago

I don't fully understand the description:

"auth_code" uses the wrong scope, "user-read-currently-playing" would be correct and works fine.

The auth_code example is using exactly the user-read-currently-playing scope:

https://github.com/ramsayleung/rspotify/blob/eb1260c24a74e8d3ce97cd3a6222da7b1d1989c3/examples/auth_code.rs#L36

Jonsen94 commented 1 month ago

Yes, sorry, you are right. The code I refer to is from the comment above it (which I used for the custom callback url):

// Same for RSPOTIFY_REDIRECT_URI. You can also set it explictly: // // // let oauth = OAuth { // redirect_uri: "http://localhost:8888/callback".to_string(), // scopes: scopes!("user-read-recently-played"), // ..Default::default(), // }; //

Sorry for the confusion.