aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java b/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java
index aa353def..c448a360 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java
@@ -58,6 +58,7 @@ public class AutoMediaBrowserService extends MediaBrowserService {
private static final String PODCAST_PREFIX = "po-";
private static final String ALBUM_TYPE_PREFIX = "ty-";
private static final String MUSIC_DIRECTORY_PREFIX = "md-";
+ private static final int MAX_DOUBLE_LINE_ITEMS = 9;
private DownloadService downloadService;
private Handler handler = new Handler();
@@ -194,7 +195,7 @@ public class AutoMediaBrowserService extends MediaBrowserService {
albumListType = "newest";
}
- return musicService.getAlbumList(albumListType, 40, 0, true, downloadService, null);
+ return musicService.getAlbumList(albumListType, MAX_DOUBLE_LINE_ITEMS, 0, true, downloadService, null);
}
@Override
@@ -286,6 +287,7 @@ public class AutoMediaBrowserService extends MediaBrowserService {
protected void done(MusicDirectory podcasts) {
List<MediaBrowser.MediaItem> mediaItems = new ArrayList<>();
+ int i = 0;
for(Entry entry: podcasts.getChildren(false, true)) {
PodcastEpisode podcast = (PodcastEpisode) entry;
Bundle podcastExtras = new Bundle();
@@ -300,6 +302,10 @@ public class AutoMediaBrowserService extends MediaBrowserService {
.build();
mediaItems.add(new MediaBrowser.MediaItem(description, MediaBrowser.MediaItem.FLAG_PLAYABLE));
+ i++;
+ if(i >= MAX_DOUBLE_LINE_ITEMS) {
+ break;
+ }
}
result.sendResult(mediaItems);