Merge pull request #190 from kmod-midori/streaming-cache

feat: cache streaming contents
This commit is contained in:
CappielloAntonio 2024-05-25 17:25:23 +02:00 committed by GitHub
commit d08c113d99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 152 additions and 1 deletions

View file

@ -23,6 +23,7 @@ object Preferences {
private const val PLAYBACK_SPEED = "playback_speed"
private const val SKIP_SILENCE = "skip_silence"
private const val IMAGE_CACHE_SIZE = "image_cache_size"
private const val STREAMING_CACHE_SIZE = "streaming_cache_size"
private const val IMAGE_SIZE = "image_size"
private const val MAX_BITRATE_WIFI = "max_bitrate_wifi"
private const val MAX_BITRATE_MOBILE = "max_bitrate_mobile"
@ -189,6 +190,14 @@ object Preferences {
return App.getInstance().preferences.getString(IMAGE_SIZE, "-1")!!.toInt()
}
/**
* Size of streaming cache in MiB.
*/
@JvmStatic
fun getStreamingCacheSize(): Long {
return App.getInstance().preferences.getString(STREAMING_CACHE_SIZE, "256")!!.toLong()
}
@JvmStatic
fun getMaxBitrateWifi(): String {
return App.getInstance().preferences.getString(MAX_BITRATE_WIFI, "0")!!