Don't list albums and playlists with only one track.

This commit is contained in:
Peter Deltchev 2016-06-05 12:27:04 -07:00
parent 9eac8153db
commit 73de10cff4
2 changed files with 4 additions and 2 deletions

View file

@ -129,7 +129,8 @@ class AlbumsController extends ApiControllerBase
->with('user', 'user.avatar', 'cover') ->with('user', 'user.avatar', 'cover')
->userDetails() ->userDetails()
->orderBy('title', 'asc') ->orderBy('title', 'asc')
->where('track_count', '>', 0); // An album with only one track is not really an album.
->where('track_count', '>', 1);
$count = $query->count(); $count = $query->count();
$perPage = 40; $perPage = 40;

View file

@ -76,7 +76,8 @@ class PlaylistsController extends ApiControllerBase
'tracks.album', 'tracks.album',
'tracks.album.user') 'tracks.album.user')
->userDetails() ->userDetails()
->where('track_count', '>', 0) // A playlist with only one track is not much of a list.
->where('track_count', '>', 1)
->whereIsPublic(true); ->whereIsPublic(true);
$this->applyFilters($query); $this->applyFilters($query);