mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 16:05:53 +03:00
[PR #179] [MERGED] Fix not allowing from token as market/country #293
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#293
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/179
Author: @Qluxzz
Created: 1/25/2021
Status: ✅ Merged
Merged: 2/7/2021
Merged by: @marioortizmanero
Base:
master← Head:fix-not-allowing-from-token📝 Commits (7)
ac297fdAdd Market enumedeadd7Update usagesbbeaf96Update existing testsb636931Add test displaying FromToken functionalitye6b5642Remove into714a113Newlinebca5867Impl to_string trait instead of into📊 Changes
4 files changed (+107 additions, -76 deletions)
View changed files
📝
src/client.rs(+58 -64)📝
src/model/enums/misc.rs(+20 -0)📝
tests/test_with_credential.rs(+6 -3)📝
tests/test_with_oauth.rs(+23 -9)📄 Description
Description
Fixes "from_token" not being a valid option for market/country.
Create Market enum which can be a country or from_token in order to satisfy both conditions.
Update usages of Country to instead use Market enum.
Update mentions and parameters of country/market to be consistent with spotify API docs.
Fixes #28
Motivation and Context
To allow market to be automatically selected from the users access-token instead of having to be supplied manually.
Dependencies
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration:
I ran all tests but the most interesting ones would be the following since they used the old Country enum
Market::Country: test_artist_top_tracksMarket::Country: test_categoriesMarket::Country: test_category_playlistsMarket::Country: test_recommendationsMarket::Country: test_search_artistI've also added a test that uses Market::FromToken functionality, but since the market supplied is not static and changes with the oauth token credentials, it maybe wouldn't be such a good test?
Market::FromToken: test_search_artist_with_from_token🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.