From 90c5f0bfdda24cbc29c3caab6ed0a4dfb378f441 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 26 Jan 2020 17:18:51 +0100 Subject: Fix download button when 'prefer streaming' is active --- .../danoeh/antennapod/adapter/actionbutton/ItemActionButton.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/de/danoeh/antennapod/adapter/actionbutton') diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java index 861c6a4be..ffc73c5fb 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/ItemActionButton.java @@ -33,7 +33,7 @@ public abstract class ItemActionButton { } @NonNull - public static ItemActionButton forItem(@NonNull FeedItem item, boolean isInQueue) { + public static ItemActionButton forItem(@NonNull FeedItem item, boolean isInQueue, boolean allowStream) { final FeedMedia media = item.getMedia(); if (media == null) { return new MarkAsPlayedActionButton(item); @@ -44,9 +44,10 @@ public abstract class ItemActionButton { return new PlayActionButton(item); } else if (isDownloadingMedia) { return new CancelDownloadActionButton(item); - } else if (UserPreferences.streamOverDownload()) { + } else if (UserPreferences.streamOverDownload() && allowStream) { return new StreamActionButton(item); - } else if (MobileDownloadHelper.userAllowedMobileDownloads() || !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) { + } else if (MobileDownloadHelper.userAllowedMobileDownloads() + || !MobileDownloadHelper.userChoseAddToQueue() || isInQueue) { return new DownloadActionButton(item, isInQueue); } else { return new AddToQueueActionButton(item); -- cgit v1.2.3