File tree Expand file tree Collapse file tree
src/main/java/com/donut/mixfile/util/file Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ android {
1717 applicationId = " com.donut.mixfile"
1818 minSdk = 26
1919 targetSdk = 36
20- versionCode = 146
21- versionName = " 2.0.1 "
20+ versionCode = 147
21+ versionName = " 2.0.2 "
2222
2323 testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
2424 vectorDrawables {
@@ -70,7 +70,7 @@ android {
7070
7171dependencies {
7272
73- implementation(" com.github.InvertGeek:mixfile-core:2.0.1 " )
73+ implementation(" com.github.InvertGeek:mixfile-core:2.0.2 " )
7474 implementation(" androidx.compose.material:material-icons-extended:1.7.8" )
7575 implementation(" com.tencent:mmkv:1.3.14" )
7676 implementation(" net.engawapg.lib:zoomable:1.6.1" )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import net.engawapg.lib.zoomable.zoomable
3131import okhttp3.CacheControl
3232import okhttp3.Interceptor
3333import okhttp3.OkHttpClient
34- import okhttp3.internal.headersContentLength
34+ import okhttp3.internal.toLongOrDefault
3535import java.util.concurrent.TimeUnit
3636
3737@Composable
@@ -83,7 +83,8 @@ val forceCacheInterceptor = Interceptor { chain ->
8383val videoDecodeInterceptor = Interceptor { chain ->
8484 val response = chain.proceed(chain.request())
8585 if (response.header(" content-type" )?.startsWith(" video/" ).isTrue()) {
86- if (response.headersContentLength() > 1024 * 1024 * 5 ) {
86+ val contentLength = response.header(" Content-Length" )?.toLongOrDefault(- 1 ) ? : 0
87+ if (contentLength > 1024 * 1024 * 5 ) {
8788 return @Interceptor response.newBuilder()
8889 .header(" Content-Length" , " ${1024 * 1024 * 3 } " )
8990 .body(response.peekBody(1024 * 1024 * 3 ))
You can’t perform that action at this time.
0 commit comments