|
|
@ -25,10 +25,10 @@ class MovieLocalRepository(private val movieDAO: MovieDAO) {
|
|
|
|
|
|
|
|
|
|
|
|
suspend fun getAllMovies() : List<Movie> = withContext(Dispatchers.IO) {
|
|
|
|
suspend fun getAllMovies() : List<Movie> = withContext(Dispatchers.IO) {
|
|
|
|
val listMovie : MutableList<Movie> = mutableListOf()
|
|
|
|
val listMovie : MutableList<Movie> = mutableListOf()
|
|
|
|
val listMoviesEntities = movieDAO.getAllMoviesDetails()
|
|
|
|
val listMoviesEntities = movieDAO.getAllMovies()
|
|
|
|
|
|
|
|
|
|
|
|
listMoviesEntities.forEach { movieEntity ->
|
|
|
|
listMoviesEntities.forEach { movieEntity ->
|
|
|
|
listMovie.add(MovieLocalMapper.mapToMovie(movieEntity.movie))
|
|
|
|
listMovie.add(MovieLocalMapper.mapToMovie(movieEntity))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
listMovie
|
|
|
|
listMovie
|
|
|
|