Read ahead on mobile data too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
XoséandClaude Opus 5.5 committed 2026-10-18 15:28:07 +02:00
1 parent 29ed836b4c
commit 08590f3224
1 file changed
+3 -2
+3 -2
View File
@@ -353,10 +353,11 @@ public class PlayerService extends Service implements MediaPlayer.OnPreparedList
}); });
} }
/** Fetches the next track whole in the background (Wi-Fi only), if it isn't here yet. Main thread. */ /** Fetches the next track whole in the background (Wi-Fi or mobile data: it's the same bytes as streaming,
* only earlier; a skipped track is the only waste), if it isn't here yet. Main thread. */
private void maybePrefetch() { private void maybePrefetch() {
final App app = App.get(); final App app = App.get();
if (prefetchBusy || app.library == null || app.onMobileData()) return; if (prefetchBusy || app.library == null) return;
PlayQueue q = PlayQueue.get(); PlayQueue q = PlayQueue.get();
final Item next = q.peekNext(); final Item next = q.peekNext();
if (next == null || next == track || next.ratingKey.equals(prefetchKey) || Downloads.get().fileFor(next) != null) return; if (next == null || next == track || next.ratingKey.equals(prefetchKey) || Downloads.get().fileFor(next) != null) return;