SourceRepositoryImpl.kt 522 B

123456789101112131415161718
  1. package eu.kanade.data.source
  2. import eu.kanade.domain.source.model.Source
  3. import eu.kanade.domain.source.repository.SourceRepository
  4. import eu.kanade.tachiyomi.source.SourceManager
  5. import kotlinx.coroutines.flow.Flow
  6. import kotlinx.coroutines.flow.map
  7. class SourceRepositoryImpl(
  8. private val sourceManager: SourceManager
  9. ) : SourceRepository {
  10. override fun getSources(): Flow<List<Source>> {
  11. return sourceManager.catalogueSources.map { sources ->
  12. sources.map(sourceMapper)
  13. }
  14. }
  15. }