fix(android): @Provides for the three library DAOs LibraryRepository needs
LibraryRepository @Inject-constructs with CachedArtistDao, CachedAlbumDao, CachedTrackDao. Hilt errored at hiltJavaCompileDebug with "MissingBinding" for all three — Phase 4 only added the @Provides bridge for AuthSessionDao in slice 10 (its single consumer). Same one-line bridge per DAO: `db.<dao>()` from the AppDatabase accessor. Future DAOs land in DatabaseModule when their first @Inject-constructed consumer appears. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+15
@@ -3,6 +3,9 @@ package com.fabledsword.minstrel.cache.db
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.fabledsword.minstrel.cache.db.dao.AuthSessionDao
|
||||
import com.fabledsword.minstrel.cache.db.dao.CachedAlbumDao
|
||||
import com.fabledsword.minstrel.cache.db.dao.CachedArtistDao
|
||||
import com.fabledsword.minstrel.cache.db.dao.CachedTrackDao
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
@@ -31,5 +34,17 @@ object DatabaseModule {
|
||||
@Singleton
|
||||
fun provideAuthSessionDao(db: AppDatabase): AuthSessionDao = db.authSessionDao()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideCachedArtistDao(db: AppDatabase): CachedArtistDao = db.cachedArtistDao()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideCachedAlbumDao(db: AppDatabase): CachedAlbumDao = db.cachedAlbumDao()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideCachedTrackDao(db: AppDatabase): CachedTrackDao = db.cachedTrackDao()
|
||||
|
||||
private const val DATABASE_NAME = "minstrel.db"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user