mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 16:18:55 +01:00 
			
		
		
		
	Bump dependencies + linting
This commit is contained in:
		@@ -44,8 +44,11 @@ class BackupFileValidator(
 | 
			
		||||
            .filter { sourceManager.get(it.key) == null }
 | 
			
		||||
            .values.map {
 | 
			
		||||
                val id = it.toLongOrNull()
 | 
			
		||||
                if (id == null) it
 | 
			
		||||
                else sourceManager.getOrStub(id).toString()
 | 
			
		||||
                if (id == null) {
 | 
			
		||||
                    it
 | 
			
		||||
                } else {
 | 
			
		||||
                    sourceManager.getOrStub(id).toString()
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            .distinct()
 | 
			
		||||
            .sorted()
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,8 @@ data class BackupTracking(
 | 
			
		||||
    @ProtoNumber(1) var syncId: Int,
 | 
			
		||||
    // LibraryId is not null in 1.x
 | 
			
		||||
    @ProtoNumber(2) var libraryId: Long,
 | 
			
		||||
    @Deprecated("Use mediaId instead", level = DeprecationLevel.WARNING) @ProtoNumber(3)
 | 
			
		||||
    @Deprecated("Use mediaId instead", level = DeprecationLevel.WARNING)
 | 
			
		||||
    @ProtoNumber(3)
 | 
			
		||||
    var mediaIdInt: Int = 0,
 | 
			
		||||
    // trackingUrl is called mediaUrl in 1.x
 | 
			
		||||
    @ProtoNumber(4) var trackingUrl: String = "",
 | 
			
		||||
 
 | 
			
		||||
@@ -30,29 +30,37 @@ class BangumiInterceptor(val bangumi: Bangumi) : Interceptor {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        val authRequest = if (originalRequest.method == "GET") originalRequest.newBuilder()
 | 
			
		||||
            .header("User-Agent", "Tachiyomi")
 | 
			
		||||
            .url(
 | 
			
		||||
                originalRequest.url.newBuilder()
 | 
			
		||||
                    .addQueryParameter("access_token", currAuth.access_token).build(),
 | 
			
		||||
            )
 | 
			
		||||
            .build() else originalRequest.newBuilder()
 | 
			
		||||
            .post(addToken(currAuth.access_token, originalRequest.body as FormBody))
 | 
			
		||||
            .header("User-Agent", "Tachiyomi")
 | 
			
		||||
            .build()
 | 
			
		||||
        val authRequest = if (originalRequest.method == "GET") {
 | 
			
		||||
            originalRequest.newBuilder()
 | 
			
		||||
                .header("User-Agent", "Tachiyomi")
 | 
			
		||||
                .url(
 | 
			
		||||
                    originalRequest.url.newBuilder()
 | 
			
		||||
                        .addQueryParameter("access_token", currAuth.access_token).build(),
 | 
			
		||||
                )
 | 
			
		||||
                .build()
 | 
			
		||||
        } else {
 | 
			
		||||
            originalRequest.newBuilder()
 | 
			
		||||
                .post(addToken(currAuth.access_token, originalRequest.body as FormBody))
 | 
			
		||||
                .header("User-Agent", "Tachiyomi")
 | 
			
		||||
                .build()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return chain.proceed(authRequest)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun newAuth(oauth: OAuth?) {
 | 
			
		||||
        this.oauth = if (oauth == null) null else OAuth(
 | 
			
		||||
            oauth.access_token,
 | 
			
		||||
            oauth.token_type,
 | 
			
		||||
            System.currentTimeMillis() / 1000,
 | 
			
		||||
            oauth.expires_in,
 | 
			
		||||
            oauth.refresh_token,
 | 
			
		||||
            this.oauth?.user_id,
 | 
			
		||||
        )
 | 
			
		||||
        this.oauth = if (oauth == null) {
 | 
			
		||||
            null
 | 
			
		||||
        } else {
 | 
			
		||||
            OAuth(
 | 
			
		||||
                oauth.access_token,
 | 
			
		||||
                oauth.token_type,
 | 
			
		||||
                System.currentTimeMillis() / 1000,
 | 
			
		||||
                oauth.expires_in,
 | 
			
		||||
                oauth.refresh_token,
 | 
			
		||||
                this.oauth?.user_id,
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        bangumi.saveToken(oauth)
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -41,8 +41,11 @@ class KomgaApi(private val client: OkHttpClient) {
 | 
			
		||||
                val progress = client
 | 
			
		||||
                    .newCall(GET("${url.replace("/api/v1/series/", "/api/v2/series/")}/read-progress/tachiyomi"))
 | 
			
		||||
                    .await().let {
 | 
			
		||||
                        if (url.contains("/api/v1/series/")) it.parseAs<ReadProgressV2Dto>()
 | 
			
		||||
                        else it.parseAs<ReadProgressDto>().toV2()
 | 
			
		||||
                        if (url.contains("/api/v1/series/")) {
 | 
			
		||||
                            it.parseAs<ReadProgressV2Dto>()
 | 
			
		||||
                        } else {
 | 
			
		||||
                            it.parseAs<ReadProgressDto>().toV2()
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                track.apply {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user