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

Fix the remaining TODOs #257

Merged
merged 10 commits into from
Oct 8, 2021
Merged

Fix the remaining TODOs #257

merged 10 commits into from
Oct 8, 2021

Conversation

marioortizmanero
Copy link
Collaborator

@marioortizmanero marioortizmanero commented Sep 25, 2021

Description

  • Renames headers to params
  • Remove URI_WRONGTYPE2
  • Adds some logging to the main library (Meta-Issue #127)
  • Makes sure all the visibilities are correct (Meta-Issue #127)
  • Fix playlist-related endpoints naming
  • Check state before request and after callback

Motivation and Context

We can finally close #127 after this, believe it or not! :))

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

CI passes successfully

@marioortizmanero marioortizmanero changed the title Some TODOs Fix the remaining TODOs Sep 25, 2021
CHANGELOG.md Outdated
+ `playlist_replace_tracks` is now `playlist_replace_items`
+ `playlist_reorder_tracks` is now `playlist_reorder_items`
+ `playlist_remove_all_occurrences_of_tracks` is now `playlist_remove_all_occurrences_of_items`
+ `playlist_remove_specific_occurrences_of_tracks` is now `playlist_remove_specific_occurrences_of_tracks`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playlist_remove_specific_occurrences_of_tracks is now playlist_remove_specific_occurrences_of_tracks

It should be playlist_remove_specific_occurrences_of_tracks is now playlist_remove_specific_occurrences_of_items?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that's a typo

@@ -92,7 +92,7 @@ pub struct SavedTrack {
}

/// Track id with specific positions track in a playlist
pub struct TrackPositions {
pub struct ItemPositions {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have renamed TrackPositions to ItemPositions, should we change the id field to something like PlayableId(ItemId)?

And we should update the doc above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so I've modified ItemPositions so that it uses borrowed data instead of owned, including &dyn PlayableId instead of Box<dyn PlayableId>. This is because ItemPositions is only passed as a short-lived wrapper and doesn't really need to hold data, in my opinion. This way we can avoid two unnecessary allocations. If that's OK with you you can merge. Otherwise we can make it owned.

@ramsayleung ramsayleung merged commit 09e7cf1 into master Oct 8, 2021
@ramsayleung ramsayleung deleted the todos branch October 8, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meta-Issue
2 participants