Skip to content

Commit

Permalink
Fix incorrect page number check
Browse files Browse the repository at this point in the history
  • Loading branch information
phoxwupsh committed Apr 28, 2024
1 parent 6cbdf90 commit 0149738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/playlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Playlist {
}

pub fn page_with_indices(&self, index: usize) -> Option<Vec<(usize, &PlaylistItem)>> {
if index - 1 > self.total_pages() {
if index > self.total_pages() {
return None;
}
let start = (index - 1) * PAGE_SIZE;
Expand Down

0 comments on commit 0149738

Please sign in to comment.