the browser-facing portion of osu!

Merge pull request #11448 from nanaya/per-page-default

Increase default per page pagination limit

authored by Dean Herbert and committed by GitHub 095d9e7b 91e17336

+2 -2
app/Http/Controllers/FollowsController.php
··· 137 137 138 138 private function indexForumTopic() 139 139 { 140 - $topics = Topic::watchedByUser($this->user)->paginate(50); 140 + $topics = Topic::watchedByUser($this->user)->paginate(); 141 141 $topicReadStatus = TopicTrack::readStatus($this->user, $topics); 142 142 $topicWatchStatus = TopicWatch::watchStatus($this->user, $topics); 143 143 ··· 193 193 ->visible() 194 194 ->orderBy('last_notified', 'DESC') 195 195 ->with('beatmapset') 196 - ->paginate(50); 196 + ->paginate(); 197 197 $totalCount = $watches->total(); 198 198 $unreadCount = $this->user->beatmapsetWatches()->visible()->unread()->count(); 199 199 $openIssues = BeatmapDiscussion
+1 -1
app/Http/Controllers/Forum/ForumsController.php
··· 89 89 ->normal() 90 90 ->showDeleted($showDeleted) 91 91 ->recent(compact('sort', 'withReplies')) 92 - ->paginate(30); 92 + ->paginate(); 93 93 94 94 $allTopics = array_merge($pinnedTopics->all(), $topics->all()); 95 95 $topicReadStatus = TopicTrack::readStatus($user, $allTopics);
+1 -1
app/Http/Controllers/Forum/TopicLogsController.php
··· 19 19 $logs = $topic->logs() 20 20 ->where('log_type', Log::LOG_FORUM_MOD) 21 21 ->orderByDesc('log_time') 22 - ->paginate(30); 22 + ->paginate(); 23 23 24 24 return ext_view('forum.topics.logs.index', compact('logs', 'topic')); 25 25 }
+1 -1
app/Http/Controllers/Forum/TopicsController.php
··· 625 625 ], ['null_missing' => true]); 626 626 627 627 $params['skip_layout'] = $params['skip_layout'] ?? false; 628 - $params['limit'] = clamp($params['limit'] ?? 20, 1, 50); 628 + $params['limit'] = clamp($params['limit'] ?? Post::PER_PAGE, 1, 50); 629 629 630 630 if ($userCanModerate) { 631 631 $params['with_deleted'] ??= ($currentUser->userProfileCustomization ?? UserProfileCustomization::DEFAULTS)['forum_posts_show_deleted'];
+3 -2
app/Http/Controllers/Multiplayer/RoomsController.php
··· 7 7 8 8 use App\Exceptions\InvariantException; 9 9 use App\Http\Controllers\Controller as BaseController; 10 + use App\Models\Model; 10 11 use App\Models\Multiplayer\Room; 11 12 use App\Transformers\Multiplayer\RoomTransformer; 12 13 ··· 114 115 115 116 public function leaderboard($roomId) 116 117 { 117 - $limit = clamp(get_int(request('limit')) ?? 50, 1, 50); 118 + $limit = clamp(get_int(request('limit')) ?? Model::PER_PAGE, 1, 50); 118 119 $room = Room::findOrFail($roomId); 119 120 120 121 // leaderboard currently requires auth so auth()->check() is not required. ··· 182 183 } 183 184 $beatmaps = $playlistItemsQuery->with('beatmap.beatmapset.beatmaps')->get()->pluck('beatmap'); 184 185 $beatmapsets = $beatmaps->pluck('beatmapset'); 185 - $highScores = $room->topScores()->paginate(50); 186 + $highScores = $room->topScores()->paginate(); 186 187 $spotlightRooms = Room::featured()->orderBy('id', 'DESC')->get(); 187 188 188 189 return ext_view('multiplayer.rooms.show', [
+2 -1
app/Http/Controllers/RankingController.php
··· 8 8 use App\Models\Beatmap; 9 9 use App\Models\Country; 10 10 use App\Models\CountryStatistics; 11 + use App\Models\Model; 11 12 use App\Models\Spotlight; 12 13 use App\Models\User; 13 14 use App\Models\UserStatistics; ··· 28 29 private $friendsOnly; 29 30 30 31 const MAX_RESULTS = 10000; 31 - const PAGE_SIZE = 50; 32 + const PAGE_SIZE = Model::PER_PAGE; 32 33 const RANKING_TYPES = ['performance', 'charts', 'score', 'country']; 33 34 const SPOTLIGHT_TYPES = ['charts']; 34 35 // in display order
+1 -1
app/Http/Controllers/Store/OrdersController.php
··· 40 40 $orders->where('status', '<>', 'incart'); 41 41 } 42 42 43 - $orders = $orders->paginate(20); 43 + $orders = $orders->paginate(); 44 44 45 45 return ext_view('store.orders.index', compact('orders')); 46 46 }
+2
app/Models/Model.php
··· 22 22 use HasFactory, Traits\FasterAttributes, Validatable; 23 23 24 24 const MAX_FIELD_LENGTHS = []; 25 + const int PER_PAGE = 50; 25 26 26 27 protected $connection = 'mysql'; 27 28 protected $guarded = []; 28 29 protected array $macros = []; 30 + protected $perPage = self::PER_PAGE; 29 31 protected $primaryKeys; 30 32 31 33 public static function booted()