summaryrefslogtreecommitdiff
path: root/playback
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2024-04-07 10:42:25 +0200
committerByteHamster <info@bytehamster.com>2024-04-07 10:42:25 +0200
commitfc40da28a7a9146cd1e3c11e5169477ba85399c1 (patch)
tree9a83a99ce1744c0355611b81f7ae838c52a04dcc /playback
parente4bac5ea71d8dc9b3cc8608b85cb461a6097e40f (diff)
parent701b1ce33999616ec3c032b00e1cc2dc3e3e801b (diff)
downloadAntennaPod-fc40da28a7a9146cd1e3c11e5169477ba85399c1.zip
Merge branch 'master' into develop
Diffstat (limited to 'playback')
-rw-r--r--playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
index f17a73a77..0f3d06b00 100644
--- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
+++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
@@ -94,6 +94,7 @@ import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedItemFilter;
import de.danoeh.antennapod.model.feed.FeedMedia;
import de.danoeh.antennapod.model.feed.FeedPreferences;
+import de.danoeh.antennapod.model.feed.SortOrder;
import de.danoeh.antennapod.model.playback.MediaType;
import de.danoeh.antennapod.model.playback.Playable;
import de.danoeh.antennapod.playback.base.PlaybackServiceMediaPlayer;
@@ -449,7 +450,11 @@ public class PlaybackService extends MediaBrowserServiceCompat {
} else if (parentId.startsWith("FeedId:")) {
long feedId = Long.parseLong(parentId.split(":")[1]);
Feed feed = DBReader.getFeed(feedId);
- feedItems = DBReader.getFeedItemList(feed, FeedItemFilter.unfiltered(), feed.getSortOrder());
+ SortOrder sortOrder = feed.getSortOrder();
+ if (sortOrder == null) {
+ sortOrder = SortOrder.DATE_NEW_OLD;
+ }
+ feedItems = DBReader.getFeedItemList(feed, FeedItemFilter.unfiltered(), sortOrder);
} else if (parentId.equals(getString(R.string.current_playing_episode))) {
FeedMedia playable = DBReader.getFeedMedia(PlaybackPreferences.getCurrentlyPlayingFeedMediaId());
if (playable != null) {
@@ -876,8 +881,12 @@ public class PlaybackService extends MediaBrowserServiceCompat {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- TileService.requestListeningState(getApplicationContext(),
- new ComponentName(getApplicationContext(), QuickSettingsTileService.class));
+ try {
+ TileService.requestListeningState(getApplicationContext(),
+ new ComponentName(getApplicationContext(), QuickSettingsTileService.class));
+ } catch (IllegalArgumentException e) {
+ Log.d(TAG, "Skipping quick settings tile setup");
+ }
}
IntentUtils.sendLocalBroadcast(getApplicationContext(), ACTION_PLAYER_STATUS_CHANGED);