1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-09-19 18:57:30 +00:00

Show watched state on channel videos

This commit is contained in:
Cadence Ember 2020-12-29 23:07:23 +13:00
parent 2faaa2e18b
commit 637f648fc7
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
3 changed files with 18 additions and 7 deletions

View File

@ -12,6 +12,13 @@ module.exports = [
const data = await fetchChannel(id, settings.instance)
const subscribed = user.isSubscribed(id)
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})
}
}

View File

@ -39,10 +39,3 @@
#watched-videos-display:checked ~ .video-list-item--watched
display: none
.video-list-item--watched
background: c.$bg-darker
padding: 8px 8px 0px
.thumbnail .image
opacity: 0.4

View File

@ -16,6 +16,17 @@
align-content: start
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
position: relative
display: flex