Skip to content

Commit

Permalink
Merge pull request #5159 from FineFindus/fix/creator-highlight
Browse files Browse the repository at this point in the history
fix: properly apply creator highlight
  • Loading branch information
Bnyro authored Nov 15, 2023
2 parents 7a69650 + 20e30b5 commit c86477c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/com/github/libretube/db/DatabaseHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ object DatabaseHelper {
}
}

suspend fun filterByWatchStatus(streams: List<WatchHistoryItem>, unfinished: Boolean = true): List<WatchHistoryItem> {
suspend fun filterByWatchStatus(
streams: List<WatchHistoryItem>,
unfinished: Boolean = true
): List<WatchHistoryItem> {
return streams.filter {
withContext(Dispatchers.IO) {
val historyItem = Database.watchPositionDao()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class CommentsAdapter(
val comment = comments[position]
holder.binding.apply {
commentAuthor.text = comment.author
if (comment.channelOwner) {
commentAuthor.setBackgroundResource(R.drawable.comment_channel_owner_bg)
}
commentAuthor.setBackgroundResource(
if (comment.channelOwner) R.drawable.comment_channel_owner_bg else 0
)
commentInfos.text = TextUtils.SEPARATOR + comment.commentedTime

commentText.movementMethod = LinkMovementMethodCompat.getInstance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import androidx.fragment.app.commit
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.media3.common.C
import androidx.media3.common.C.WakeMode
import androidx.media3.common.MediaItem
import androidx.media3.common.MediaItem.SubtitleConfiguration
import androidx.media3.common.MimeTypes
Expand Down
15 changes: 8 additions & 7 deletions app/src/main/java/com/github/libretube/util/PlayingQueue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,16 @@ object PlayingQueue {
}
}

private fun fetchMoreFromPlaylist(playlistId: String, nextPage: String?, isMainList: Boolean) = runCatchingIO {
var playlistNextPage = nextPage
while (playlistNextPage != null) {
RetrofitInstance.authApi.getPlaylistNextPage(playlistId, playlistNextPage).run {
addToQueueAsync(relatedStreams, isMainList = isMainList)
playlistNextPage = this.nextpage
private fun fetchMoreFromPlaylist(playlistId: String, nextPage: String?, isMainList: Boolean) =
runCatchingIO {
var playlistNextPage = nextPage
while (playlistNextPage != null) {
RetrofitInstance.authApi.getPlaylistNextPage(playlistId, playlistNextPage).run {
addToQueueAsync(relatedStreams, isMainList = isMainList)
playlistNextPage = this.nextpage
}
}
}
}

fun insertPlaylist(playlistId: String, newCurrentStream: StreamItem?) = runCatchingIO {
val playlist = PlaylistsHelper.getPlaylist(playlistId)
Expand Down

0 comments on commit c86477c

Please sign in to comment.