From 41580b57cc06c297615bc3484274859bb0c9c5c1 Mon Sep 17 00:00:00 2001 From: Herbert Reiter <46045854+damoasda@users.noreply.github.com> Date: Fri, 2 Oct 2020 23:03:30 +0200 Subject: [PATCH] Local feeds: Do not display streaming confirmation (#4468) --- .../core/service/playback/PlaybackService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 9b373b3b9..bf485e55f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -35,6 +35,7 @@ import android.util.Log; import android.util.Pair; import android.view.KeyEvent; import android.view.SurfaceHolder; +import android.webkit.URLUtil; import android.widget.Toast; import com.bumptech.glide.Glide; @@ -482,7 +483,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (allowStreamAlways) { UserPreferences.setAllowMobileStreaming(true); } - if (stream && !NetworkUtils.isStreamingAllowed() && !allowStreamThisTime) { + boolean localFeed = URLUtil.isContentUrl(playable.getStreamUrl()); + if (stream && !NetworkUtils.isStreamingAllowed() && !allowStreamThisTime && !localFeed) { displayStreamingNotAllowedNotification(intent); PlaybackPreferences.writeNoMediaPlaying(); stateManager.stopService(); @@ -668,7 +670,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { private void startPlayingFromPreferences() { Playable playable = Playable.PlayableUtils.createInstanceFromPreferences(getApplicationContext()); if (playable != null) { - if (PlaybackPreferences.getCurrentEpisodeIsStream() && !NetworkUtils.isStreamingAllowed()) { + boolean localFeed = URLUtil.isContentUrl(playable.getStreamUrl()); + if (PlaybackPreferences.getCurrentEpisodeIsStream() && !NetworkUtils.isStreamingAllowed() && !localFeed) { displayStreamingNotAllowedNotification( new PlaybackServiceStarter(this, playable) .prepareImmediately(true) @@ -957,7 +960,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } if (!nextItem.getMedia().localFileAvailable() && !NetworkUtils.isStreamingAllowed() - && UserPreferences.isFollowQueue()) { + && UserPreferences.isFollowQueue() && !nextItem.getFeed().isLocalFeed()) { displayStreamingNotAllowedNotification( new PlaybackServiceStarter(this, nextItem.getMedia()) .prepareImmediately(true)