Skip to content

Commit

Permalink
fix: make 'popular' categories use active_installs desc for order (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckadams authored Feb 23, 2025
1 parent 5650811 commit ef02a5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/Services/Plugins/QueryPluginsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ private static function applyTag(Builder $query, string $tag): void
*/
private static function applyBrowse(Builder $query, string $browse): void
{
// TODO: replicate 'featured' browse (currently it's identical to 'popular')
// TODO: replicate 'featured' browse (currently it's identical to 'top-rated')
match ($browse) {
'new' => $query->reorder('added', 'desc'),
'updated' => $query->reorder('last_updated', 'desc'),
'top-rated', 'popular', 'featured' => $query->reorder('rating', 'desc'),
default => $query->reorder('active_installs', 'desc'),
'top-rated', 'featured' => $query->reorder('rating', 'desc'),
default => $query->reorder('active_installs', 'desc'), // 'popular' is also the default
};
}

Expand Down
4 changes: 2 additions & 2 deletions app/Services/Themes/QueryThemesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ private static function applyBrowse(Builder $query, string $browse): void
{
// TODO: replicate 'featured' browse (currently it's identical to 'popular')
match ($browse) {
'popular', 'featured' => $query->reorder('rating', 'desc'),
'featured' => $query->reorder('rating', 'desc'),
'new' => $query->reorder('creation_time', 'desc'),
default => null,
default => $query->reorder('active_installs', 'desc'), // 'popular' is also the default
};
}

Expand Down

0 comments on commit ef02a5b

Please sign in to comment.