Skip to content

Commit

Permalink
Browse Category is broken #622
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed Dec 5, 2023
1 parent 88848d6 commit 5324418
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spotify-mini-player/src/secondDelimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2627,15 +2627,20 @@ function secondDelimiterBrowse($w, $query, $db, $update_in_progress) {
$api = getSpotifyWebAPI($w);
$offsetListCategories = 0;
$limitListCategories = 50;
$categories= array();
do {
$listCategories = $api->getCategoriesList(array('country' => $country, 'limit' => $limitListCategories, 'locale' => '', 'offset' => $offsetListCategories,));
$offsetListCategories += $limitListCategories;

foreach ($listCategories
->categories->items as $category) {
$categories[] = $category;
}
} while ($offsetListCategories < $listCategories
->categories
->total);

foreach ($listCategories
->categories->items as $category) {
foreach ($categories as $category) {

if (countCharacters($search) < 2 || strpos(strtolower($category->name), strtolower($search)) !== false) {
$w->result(null, '', escapeQuery($category->name), 'Browse this category', getCategoryArtwork($w, $category->id, $category->icons[0]->url, true, false, $use_artworks), 'no', null, 'Browse▹' . $country . '▹' . $category->id . '▹');
Expand Down

0 comments on commit 5324418

Please sign in to comment.