Skip to content

Commit 5324418

Browse files
committed
Browse Category is broken #622
1 parent 88848d6 commit 5324418

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spotify-mini-player/src/secondDelimiter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,15 +2627,20 @@ function secondDelimiterBrowse($w, $query, $db, $update_in_progress) {
26272627
$api = getSpotifyWebAPI($w);
26282628
$offsetListCategories = 0;
26292629
$limitListCategories = 50;
2630+
$categories= array();
26302631
do {
26312632
$listCategories = $api->getCategoriesList(array('country' => $country, 'limit' => $limitListCategories, 'locale' => '', 'offset' => $offsetListCategories,));
26322633
$offsetListCategories += $limitListCategories;
2634+
2635+
foreach ($listCategories
2636+
->categories->items as $category) {
2637+
$categories[] = $category;
2638+
}
26332639
} while ($offsetListCategories < $listCategories
26342640
->categories
26352641
->total);
26362642

2637-
foreach ($listCategories
2638-
->categories->items as $category) {
2643+
foreach ($categories as $category) {
26392644

26402645
if (countCharacters($search) < 2 || strpos(strtolower($category->name), strtolower($search)) !== false) {
26412646
$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 . '');

0 commit comments

Comments
 (0)