Skip to content

Commit

Permalink
Rename 2 methods in TVSeries Service interface
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezaeiii committed Nov 3, 2024
1 parent 30cae3b commit c6965a1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ interface TVShowService {
suspend fun fetchImages(@Path("tvId") tvId: Int): ImagesResponse

@GET("3/tv/{tvId}/similar")
suspend fun fetchSimilarMovies(@Path("tvId") tvId: Int): TMDbWrapper<NetworkTVShow>
suspend fun fetchSimilarTVSeries(@Path("tvId") tvId: Int): TMDbWrapper<NetworkTVShow>

@GET("3/tv/{TvId}/similar")
suspend fun fetchSimilarMovies(@Path("TvId") tvId: Int, @Query("page") page: Int): TMDbWrapper<NetworkTVShow>
suspend fun fetchSimilarTVSeries(@Path("TvId") tvId: Int, @Query("page") page: Int): TMDbWrapper<NetworkTVShow>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import com.sample.tmdb.domain.paging.BasePagingSource
class SimilarTvSeriesPagingSource(context: Context, private val tvShowApi: TVShowService, private val tvId: Int) :
BasePagingSource<TVShow>(context) {
override suspend fun fetchItems(page: Int): List<TVShow> =
tvShowApi.fetchSimilarMovies(tvId, page).items.asTVShowDomainModel()
tvShowApi.fetchSimilarTVSeries(tvId, page).items.asTVShowDomainModel()
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ class TVShowDetailRepository @Inject constructor(
override suspend fun getImages(id: Int): List<TMDbImage> = tvShowApi.fetchImages(id).asDomainModel()

override suspend fun getSimilarItems(id: Int): List<TMDbItem> =
tvShowApi.fetchSimilarMovies(id).items.asTVShowDomainModel()
tvShowApi.fetchSimilarTVSeries(id).items.asTVShowDomainModel()
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ class TVShowDetailRepositoryTest : BaseDetailRepositoryTest<TvDetails>() {
)
`when`(api.tvCredit(anyInt())).thenReturn(NetworkCreditWrapper(emptyList(), emptyList()))
`when`(api.fetchImages(anyInt())).thenReturn(ImagesResponse(emptyList(), ID, emptyList()))
`when`(api.fetchSimilarMovies(anyInt())).thenReturn(TMDbWrapper(emptyList()))
`when`(api.fetchSimilarTVSeries(anyInt())).thenReturn(TMDbWrapper(emptyList()))
}
}

0 comments on commit c6965a1

Please sign in to comment.