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:
parent
2faaa2e18b
commit
637f648fc7
3 changed files with 18 additions and 7 deletions
|
|
@ -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})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue