diff --git a/lib/MetaCPAN/Query/Release.pm b/lib/MetaCPAN/Query/Release.pm index 22df8c5f9..9cda0c8eb 100644 --- a/lib/MetaCPAN/Query/Release.pm +++ b/lib/MetaCPAN/Query/Release.pm @@ -426,8 +426,9 @@ sub by_author_and_names { } sub by_author { - my ( $self, $pauseid, $size ) = @_; + my ( $self, $pauseid, $size, $page ) = @_; $size //= 1000; + $page //= 1; my $body = { query => { @@ -444,6 +445,7 @@ sub by_author { qw( abstract author authorized date distribution license metadata.version resources.repository status tests ) ], size => $size, + from => ( $page - 1 ) * $size, }; my $ret = $self->es->search( diff --git a/lib/MetaCPAN/Server/Controller/Release.pm b/lib/MetaCPAN/Server/Controller/Release.pm index e9921d53b..9bee79957 100644 --- a/lib/MetaCPAN/Server/Controller/Release.pm +++ b/lib/MetaCPAN/Server/Controller/Release.pm @@ -61,8 +61,8 @@ sub recent : Path('recent') : Args(0) { sub by_author : Path('by_author') : Args(1) { my ( $self, $c, $pauseid ) = @_; - $c->stash_or_detach( - $self->model($c)->by_author( $pauseid, $c->req->param('size') ) ); + $c->stash_or_detach( $self->model($c) + ->by_author( $pauseid, @{ $c->req->params }{qw( size page )} ) ); } sub latest_by_distribution : Path('latest_by_distribution') : Args(1) {