ramsayleung / rspotify

Spotify Web API SDK implemented on Rust
MIT License
639 stars 123 forks source link

How can I work with/extract the data i need from a SearchResult? #339

Closed ultrex22 closed 2 years ago

ultrex22 commented 2 years ago

After searching for a Track, and getting a SearchResult back, I cannot find any info online on how to work with the returned data. I cannot index into it, or use dot notation. I'm unsure what the point is if I cannot work with the data. I'm sure I'm missing something, but after 2 days of looking, I'm about o move on. So I thought I would send a request for further info. Any help you can give at all is appreciated. Thanks for your time!

marioortizmanero commented 2 years ago

What are you having problems with? There are multiple kinds of results you may obtain (tracks, albums, etc). If you only want tracks, then match against the Tracks variant. Then, you can find them in the items page in the Page type.

@ramsayleung, should we enable the GitHub discussions feature for this repo? I feel like these questions would fit best in there. I think that only you can enable that, as the creator of the repo.

ultrex22 commented 2 years ago

Thank you for the quick reply! I needed to get the URI for a list of songs to create a playlist. I couldn't figure out how to access the data, but I tried the match and of course, that is what I needed/ was missing. I'm new to programming, with about 1.25 years of learning Python, and about 6mo. or rust. Thank you for the help! I have been converting some of my Python programs to Rust for practice. I have been learning a lot and getting more confidence. Thanks again!

marioortizmanero commented 2 years ago

No worries. Best of luck in your journey!

I feel like this library is really popular for new users because it's practical and straightforward. So any feedback you may think of will be useful to us as well, so that everyone in your situation has it easier in the future.

ramsayleung commented 2 years ago

@ramsayleung, should we enable the GitHub discussions feature for this repo? I feel like these questions would fit best in there. I think that only you can enable that, as the creator of the repo.

I have enabled the discussion feature for RSpotify: https://github.com/ramsayleung/rspotify/discussions/340, you could start our first discussion :)