Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make available_markets optional #286

Merged
merged 3 commits into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.11.3

**Breaking changes:**
- ([#286](https://github.com/ramsayleung/rspotify/pull/286)) Make `available_markets` optional for `FullAlbum`

## 0.11 (2021.10.14)

This release contains *lots* of breaking changes. These were necessary to continue Rspotify's development, and this shouldn't happen again. From now on we'll work on getting closer to the first stable release. Lots of internal code was rewritten to make Rspotify more flexible, performant and easier to use. Sorry for the inconvenience!
Expand Down
2 changes: 1 addition & 1 deletion rspotify-model/src/album.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct SimplifiedAlbum {
pub struct FullAlbum {
pub artists: Vec<SimplifiedArtist>,
pub album_type: AlbumType,
pub available_markets: Vec<String>,
pub available_markets: Option<Vec<String>>,
pub copyrights: Vec<Copyright>,
pub external_ids: HashMap<String, String>,
pub external_urls: HashMap<String, String>,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_with_oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ async fn test_current_user_saved_albums() {

// Making sure the new albums appear
let all_albums = fetch_all(client.current_user_saved_albums(None)).await;
// Can handle albums without available_market
let _albums_from_token =
fetch_all(client.current_user_saved_albums(Some(&Market::FromToken))).await;
let all_uris = all_albums
.into_iter()
.map(|a| a.album.id)
Expand Down