Skip to content

Instantly share code, notes, and snippets.

@DivS-15
Created May 22, 2022 05:27
Show Gist options
  • Save DivS-15/4ebb2c0eb12a17883801da70b581d3c8 to your computer and use it in GitHub Desktop.
Save DivS-15/4ebb2c0eb12a17883801da70b581d3c8 to your computer and use it in GitHub Desktop.
@Singleton
class VideoRepository @Inject constructor(
private val coroutineScope: CoroutineScope,
private val apiService: VideosRemoteInterface
) {
fun videosPagingSource() = VideosPagingSource(coroutineScope, apiService)
suspend fun loadChannelThumbnail(channelId: String): String {
return apiService.getChannelDetails(channelId).items[0].snippet.thumbnails.default.url
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment