diff --git a/app/src/main/kotlin/com/subtracks/data/repo/DownloadRepository.kt b/app/src/main/kotlin/com/subtracks/data/repo/DownloadRepository.kt index a9631fce..96a6a671 100644 --- a/app/src/main/kotlin/com/subtracks/data/repo/DownloadRepository.kt +++ b/app/src/main/kotlin/com/subtracks/data/repo/DownloadRepository.kt @@ -248,10 +248,9 @@ class DownloadRepository( return@withContext } // Under one lock, so a cancel that lands mid-loop waits for the queue to be complete and - // then removes all of it, rather than missing the songs enqueued after it looked. - // ponytail: the lock is held for the whole insert pass, so cancel latency scales with the - // list length; the promote below hands over at most IN_FLIGHT_LIMIT, which is what keeps - // the platform's queue (and our poll writes) bounded. + // then removes all of it, rather than missing the songs enqueued after it looked. Holding + // it for the whole insert pass makes cancel latency scale with the list length; the promote + // below hands over at most IN_FLIGHT_LIMIT, which bounds the platform's queue. val promoted = mutex.withLock { songIds.forEach { songId -> diff --git a/app/src/main/kotlin/com/subtracks/data/sync/SyncService.kt b/app/src/main/kotlin/com/subtracks/data/sync/SyncService.kt index 848e0147..ed04086d 100644 --- a/app/src/main/kotlin/com/subtracks/data/sync/SyncService.kt +++ b/app/src/main/kotlin/com/subtracks/data/sync/SyncService.kt @@ -93,8 +93,7 @@ class SyncService( library.deleteOrphanPlaylistSongs(source.id) } - // ponytail: one commit per batch means Room notifies paged observers once per batch; gate - // UI observation on SyncStatus.Running if that churn is ever noticeable. + // One commit per batch, so Room notifies paged observers once per batch rather than per row. private suspend fun write( table: String, columns: List, diff --git a/app/src/main/kotlin/com/subtracks/playback/PlaybackController.kt b/app/src/main/kotlin/com/subtracks/playback/PlaybackController.kt index 71c73a3d..349c58ad 100644 --- a/app/src/main/kotlin/com/subtracks/playback/PlaybackController.kt +++ b/app/src/main/kotlin/com/subtracks/playback/PlaybackController.kt @@ -1465,8 +1465,8 @@ class PlaybackController( const val SEED_PIN_TRIES = 1_000_000 const val FILE_SCHEME = "file:" - // ponytail: walks the queue one row at a time to find the next downloaded track; swap for a - // single query over the downloaded ids if a sparse queue ever makes the scan noticeable. + // The offline scan walks the queue one row at a time to find the next downloaded track, so + // this caps the work on a sparse queue. const val OFFLINE_SCAN_LIMIT = 10_000L } }