Skip to content

Commit

Permalink
Fix song paging
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Aug 27, 2024
1 parent 77cc157 commit fb06f39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/concerns/ambiguity/song_title.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def fetch_song_tracks
end

def constrained_page_param(tracks)
[ tracks.paginate(page: 1).total_pages, params[:page]&.to_i || 1 ].min
total = (tracks.count.to_f / (params[:per_page].presence || 20)).ceil
[ total, params[:page]&.to_i || 1 ].min
end

def tagged_tracks(tracks)
Expand Down

0 comments on commit fb06f39

Please sign in to comment.