1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-03-02 10:41:36 +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})
}
}