mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #157] [MERGED] Keep polishing the models #275
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#275
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/157
Author: @ramsayleung
Created: 11/21/2020
Status: ✅ Merged
Merged: 12/15/2020
Merged by: @ramsayleung
Base:
master← Head:ramsay_refactor_model📝 Commits (10+)
3f4e294RemoveFullArtistsstruct, define it inside the endpoint function.9321596Merge branch 'master' into ramsay_refactor_modelb83a7b8Update CHANGELOG about removingFullArtists.edf7d2cReplace FullTracks with Vec.748d996Update document.645bbabReplaceAudioFeaturesPayloadwithVec<AudioFeatures>.2463b6bUpdate CHANGELOG.7373529Recover wrapper objects and make them public in cratede43450Update CHANGELOG and remove unnecessary derived traits.bc7c931ReduceFullAlbumswrapper object📊 Changes
16 files changed (+744 additions, -113 deletions)
View changed files
📝
CHANGELOG.md(+22 -2)📝
examples/with_refresh_token.rs(+1 -1)📝
src/client.rs(+31 -22)📝
src/model/album.rs(+4 -6)📝
src/model/artist.rs(+4 -6)📝
src/model/audio.rs(+10 -4)📝
src/model/category.rs(+2 -3)📝
src/model/context.rs(+32 -21)📝
src/model/device.rs(+21 -3)📝
src/model/mod.rs(+121 -1)📝
src/model/offset.rs(+10 -3)📝
src/model/show.rs(+22 -7)📝
src/model/track.rs(+16 -7)📝
src/util.rs(+1 -1)📝
tests/test_models.rs(+433 -26)📝
tests/test_with_oauth.rs(+14 -0)📄 Description
Description
Keep polish the models by following the issues:
Motivation and Context
To make
rspotify's API easier to use.FullTracksCursorPageFullArtistsSeversalSimplifiedShowsDevicePayloadAudioFeaturesPayloadPageCategoryPageSimpliedAlbumsFullAlbumsFullArtistsAudioAnalysisSection::modeandAudioFeatures::modearef32sbut should beOption<Mode>swhereenum Mode { Major, Minor }as it is more useful.CursorBasedPageshould also not include the URLs.AudioFeatures.duration_msto duration, and change its type fromu32tostd::time::Duration.FullEpisode.duration_msto duration, and change its type fromu32tostd::time::Duration.SimplifiedEpisode.duration_msto duration, and change its type fromu32tostd::time::Duration.FullTrack.duration_msto duration, and change its type fromu32tostd::time::Duration.SimplifiedTrack.duration_msto duration, and change its type fromu32tostd::time::Duration.SimplifiedEpisode::duration_msshould be aDuration.Offset::positionshould be aDurationCurrentlyPlayingContext::progress_msshould beprogress:Option<Duration>.CurrentPlaybackContext::progress_msshould beprogress:Option<Duration>.ResumePoint::resume_position_msshould be aDuration.CurrentlyPlayingContext::timestampshould be aDateTime<Utc>CurrentPlaybackContext::timestampshould be aDateTime<Utc>(SimplifiedPlayingContext::timestampshould be aDateTime<Utc>SimplifiedPlayingContextis useless, just remove it.)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
FullArtists:test_artist_related_artists,test_artistsFullTracks:test_artist_top_tracks,test_tracksCursorPageFullArtists:test_current_user_followed_artistsSeversalSimplifiedShows:test_get_seversal_showsDevicePayload:test_deviceAudioFeaturesPayload:test_audios_featuresPageCategory:test_categoriesPageSimpliedAlbums:test_new_releasesFullAlbums:test_albumsduration_mstoduration, and change its type fromf32tostd::time::DurationAudioFeatures:test_audio_featuresFullEpisode:test_full_episodeSimplifiedEpisode:simplified_episodeFullTrack:test_full_trackSimplifiedTrack:test_simplified_trackResumePoint::resume_position_msshould be aDuration:test_resume_pointCurrentlyPlayingContext/CurrentlyPlaybackContext/SimplifiedPlayingContext::timestampshould be aDateTime<Utc>CurrentlyPlayingContext:test_currently_playing_contextCurrentPlaybackContext:test_current_playback_contextOffset::positionshould be aDuration:test_offsetPS: it seems the pull request template doesn't works, I just add the content manually, and I would like to open a new PR to test the pull request template individually
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.