[GH-ISSUE #407] Incorrect type for playlist position #130

Closed
opened 2026-02-27 20:23:18 +03:00 by kerem · 3 comments
Owner

Originally created by @hrkfdn on GitHub (Apr 29, 2023).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/407

Describe the bug
With #375 some types were changed from integers to chrono::Duration. While this is a great change, I believe a mistake snuck in:

github.com/ramsayleung/rspotify@0a6c136b56/src/clients/oauth.rs (L292-L315)

Expected behavior

The position in this method is a playlist position and not time related. I don't think chrono::Duration is appropriate here. What do you think?

Originally created by @hrkfdn on GitHub (Apr 29, 2023). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/407 **Describe the bug** With #375 some types were changed from integers to `chrono::Duration`. While this is a great change, I believe a mistake snuck in: https://github.com/ramsayleung/rspotify/blob/0a6c136b56ab1e882e26ac536a44c405a37706e4/src/clients/oauth.rs#L292-L315 **Expected behavior** The position in this method is a playlist position and not time related. I don't think `chrono::Duration` is appropriate here. What do you think?
kerem 2026-02-27 20:23:18 +03:00
Author
Owner

@ramsayleung commented on GitHub (May 4, 2023):

Agree, it should be an integer instead of Duration, because it's a zero-based index. I would like to fix it as soon as possible.

<!-- gh-comment-id:1535156269 --> @ramsayleung commented on GitHub (May 4, 2023): Agree, it should be an integer instead of `Duration`, because it's a zero-based index. I would like to fix it as soon as possible.
Author
Owner

@ramsayleung commented on GitHub (May 22, 2023):

This problem has been fixed, the type of position rollback to Option<u32>

<!-- gh-comment-id:1557838673 --> @ramsayleung commented on GitHub (May 22, 2023): This problem has been fixed, the type of `position` rollback to `Option<u32>`
Author
Owner

@hrkfdn commented on GitHub (May 22, 2023):

Hooray, thanks! 🎉

<!-- gh-comment-id:1557903374 --> @hrkfdn commented on GitHub (May 22, 2023): Hooray, thanks! :tada:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#130
No description provided.