mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
bind the download engine by its interface in Koin
`single { SystemDownloadEngine(...) }` registers the concrete class, but
DownloadRepository asks for the DownloadEngine interface, so resolving
PlaybackController threw NoDefinitionFoundException and the app died on launch
with a Koin InstanceCreationException. It is now `single<DownloadEngine>`, the
way the other interface singletons in the module are declared.
Nothing in the suite ever started Koin — the repository tests build the
repository directly with a fake — which is why a launch-crashing binding got
through. AppModuleTest now resolves the playback graph from the real module, and
it failed with the same NoDefinitionFoundException before this fix.
This commit is contained in:
@@ -6,6 +6,7 @@ import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.widget.Toast
|
||||
import com.subtracks.data.db.createAndroidDatabase
|
||||
import com.subtracks.data.download.DownloadEngine
|
||||
import com.subtracks.data.download.SystemDownloadEngine
|
||||
import com.subtracks.data.net.networkMode
|
||||
import com.subtracks.data.prefs.createUserPreferences
|
||||
@@ -48,7 +49,7 @@ fun appModule(
|
||||
single<ArtworkSeedStore> { ArtworkSeedRepository(get()) }
|
||||
single { SyncManager(get(), get(), get()) }
|
||||
single { QueueRepository(get()) }
|
||||
single { SystemDownloadEngine(context.applicationContext) }
|
||||
single<DownloadEngine> { SystemDownloadEngine(context.applicationContext) }
|
||||
single {
|
||||
DownloadRepository(
|
||||
db = get(),
|
||||
|
||||
Reference in New Issue
Block a user