mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-22 15:47:30 +00:00
Show watched state on channel videos
This commit is contained in:
parent
2faaa2e18b
commit
637f648fc7
@ -12,6 +12,13 @@ module.exports = [
|
|||||||
const data = await fetchChannel(id, settings.instance)
|
const data = await fetchChannel(id, settings.instance)
|
||||||
const subscribed = user.isSubscribed(id)
|
const subscribed = user.isSubscribed(id)
|
||||||
const instanceOrigin = settings.instance
|
const instanceOrigin = settings.instance
|
||||||
|
// apply watched status
|
||||||
|
const watchedVideos = user.getWatchedVideos()
|
||||||
|
if (data.latestVideos) {
|
||||||
|
data.latestVideos.forEach(video => {
|
||||||
|
video.watched = watchedVideos.includes(video.videoId)
|
||||||
|
})
|
||||||
|
}
|
||||||
return render(200, "pug/channel.pug", {data, subscribed, instanceOrigin})
|
return render(200, "pug/channel.pug", {data, subscribed, instanceOrigin})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,3 @@
|
|||||||
|
|
||||||
#watched-videos-display:checked ~ .video-list-item--watched
|
#watched-videos-display:checked ~ .video-list-item--watched
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
.video-list-item--watched
|
|
||||||
background: c.$bg-darker
|
|
||||||
padding: 8px 8px 0px
|
|
||||||
|
|
||||||
.thumbnail .image
|
|
||||||
opacity: 0.4
|
|
||||||
|
@ -16,6 +16,17 @@
|
|||||||
align-content: start
|
align-content: start
|
||||||
margin-bottom: 12px
|
margin-bottom: 12px
|
||||||
|
|
||||||
|
@at-root .video-list-item--watched#{&}
|
||||||
|
background: c.$bg-darker
|
||||||
|
padding: 8px 8px 0px
|
||||||
|
margin: -8px -8px 12px
|
||||||
|
|
||||||
|
.thumbnail
|
||||||
|
margin-bottom: 8px
|
||||||
|
|
||||||
|
.image
|
||||||
|
opacity: 0.4
|
||||||
|
|
||||||
.thumbnail
|
.thumbnail
|
||||||
position: relative
|
position: relative
|
||||||
display: flex
|
display: flex
|
||||||
|
Loading…
Reference in New Issue
Block a user