[SoundcloudBridge] Fix for artists with few tracks (#970)

Artists with less than 10 tracks would return blank articles. This fixes that.
This commit is contained in:
Roliga 2018-12-26 20:35:05 +01:00 committed by LogMANOriginal
parent 6c1d861529
commit 4438807b26

View file

@ -32,7 +32,8 @@ class SoundCloudBridge extends BridgeAbstract {
. self::CLIENT_ID . self::CLIENT_ID
)) or returnServerError('No results for this user'); )) or returnServerError('No results for this user');
for($i = 0; $i < 10; $i++) { $numTracks = min(count($tracks), 10);
for($i = 0; $i < $numTracks; $i++) {
$item = array(); $item = array();
$item['author'] = $tracks[$i]->user->username; $item['author'] = $tracks[$i]->user->username;
$item['title'] = $tracks[$i]->user->username . ' - ' . $tracks[$i]->title; $item['title'] = $tracks[$i]->user->username . ' - ' . $tracks[$i]->title;