mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-31 19:04:52 +01:00
Add item to queue once it's downloaded
This commit is contained in:
parent
9dec0546bd
commit
58747d227a
@ -570,7 +570,6 @@ public class FeedManager {
|
||||
/** Downloads FeedItems if they have not been downloaded yet. */
|
||||
public void downloadFeedItem(final Context context, FeedItem... items)
|
||||
throws DownloadRequestException {
|
||||
List<FeedItem> addToQueue = new ArrayList<FeedItem>();
|
||||
|
||||
for (FeedItem item : items) {
|
||||
if (item.getMedia() != null
|
||||
@ -591,13 +590,8 @@ public class FeedManager {
|
||||
} else {
|
||||
requester.downloadMedia(context, item.getMedia());
|
||||
}
|
||||
addToQueue.add(item);
|
||||
}
|
||||
}
|
||||
if (UserPreferences.isAutoQueue()) {
|
||||
addQueueItem(context,
|
||||
addToQueue.toArray(new FeedItem[addToQueue.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,6 +58,7 @@ import de.danoeh.antennapod.feed.FeedImage;
|
||||
import de.danoeh.antennapod.feed.FeedItem;
|
||||
import de.danoeh.antennapod.feed.FeedManager;
|
||||
import de.danoeh.antennapod.feed.FeedMedia;
|
||||
import de.danoeh.antennapod.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.storage.DownloadRequestException;
|
||||
import de.danoeh.antennapod.storage.DownloadRequester;
|
||||
import de.danoeh.antennapod.syndication.handler.FeedHandler;
|
||||
@ -831,7 +832,7 @@ public class DownloadService extends Service {
|
||||
} finally {
|
||||
mediaplayer.release();
|
||||
}
|
||||
|
||||
|
||||
if (media.getItem().getChapters() == null) {
|
||||
ChapterUtils.loadChaptersFromFileUrl(media);
|
||||
if (media.getItem().getChapters() != null) {
|
||||
@ -847,6 +848,12 @@ public class DownloadService extends Service {
|
||||
manager.setFeedMedia(DownloadService.this, media);
|
||||
}
|
||||
|
||||
if (UserPreferences.isAutoQueue()
|
||||
&& !FeedManager.getInstance().isInQueue(media.getItem())) {
|
||||
FeedManager.getInstance().addQueueItem(DownloadService.this,
|
||||
media.getItem());
|
||||
}
|
||||
|
||||
downloadsBeingHandled -= 1;
|
||||
handler.post(new Runnable() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user