diff options
author | ByteHamster <info@bytehamster.com> | 2022-09-30 17:46:13 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-10-04 19:48:47 +0200 |
commit | b0b95f0a05c216e8af62b21433658e2cc0c55441 (patch) | |
tree | 54068739d18f0f01a3b93eae030d517b75e9ceb9 /storage | |
parent | b605901c52bffd7b274a0718840acd189b3717e4 (diff) | |
download | AntennaPod-b0b95f0a05c216e8af62b21433658e2cc0c55441.zip |
Reorder queue section when pressing play, not when pausing
Diffstat (limited to 'storage')
-rw-r--r-- | storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java index c0ca018f1..39454a106 100644 --- a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java +++ b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java @@ -1005,7 +1005,10 @@ public class PodDBAdapter { + " INNER JOIN " + TABLE_NAME_FEED_ITEMS + " ON " + SELECT_KEY_ITEM_ID + " = " + TABLE_NAME_QUEUE + "." + KEY_FEEDITEM + JOIN_FEED_ITEM_AND_MEDIA - + " ORDER BY " + TABLE_NAME_FEED_MEDIA + "." + KEY_POSITION + " >= 1000 DESC , " + // In the front: Episodes that have a position >1sec, but also the episode that was just started + + " ORDER BY (" + TABLE_NAME_FEED_MEDIA + "." + KEY_POSITION + " >= 1000" + + " OR " + TABLE_NAME_FEED_MEDIA + "." + KEY_LAST_PLAYED_TIME + + " >= " + (System.currentTimeMillis() - 30000) + ") DESC , " + TABLE_NAME_FEED_MEDIA + "." + KEY_LAST_PLAYED_TIME + " DESC , " + TABLE_NAME_QUEUE + "." + KEY_ID + " LIMIT " + limit; return db.rawQuery(query, null); |