From 62b73339931a299d73dd3c1357490382bfef3bff Mon Sep 17 00:00:00 2001 From: tristancorbellari Date: Tue, 9 Jan 2024 10:01:42 +0200 Subject: [PATCH] Pass library preferences to chapter cache via DI --- .../main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt | 3 +-- app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt index e6cf89f442..eb03ac59ee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt @@ -31,10 +31,9 @@ import java.io.IOException class ChapterCache( private val context: Context, private val json: Json, + var libraryPreferences: LibraryPreferences, ) { - val libraryPreferences = Injekt.get() - /** Cache class used for cache management. */ private val diskCache = DiskLruCache.open( File(context.cacheDir, "chapter_disk_cache"), diff --git a/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt b/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt index ef0f65fff1..56893052c5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt @@ -114,7 +114,7 @@ class AppModule(val app: Application) : InjektModule { addSingletonFactory { UniFileTempFileManager(app) } - addSingletonFactory { ChapterCache(app, get()) } + addSingletonFactory { ChapterCache(app, get(), get()) } addSingletonFactory { CoverCache(app) } addSingletonFactory { NetworkHelper(app, get()) }