1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-03-02 02:31:35 +00:00

Display how recently channels were refreshed

This commit is contained in:
Cadence Ember 2020-09-24 00:48:32 +12:00
parent 2e69dfc4b7
commit 83dec0c7ab
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
4 changed files with 31 additions and 10 deletions

View file

@ -9,6 +9,9 @@ const prepared = {
+ " ( videoId, title, author, authorId, published, viewCountText, descriptionHtml)"
+ " VALUES"
+ " (@videoId, @title, @author, @authorId, @published, @viewCountText, @descriptionHtml)"
),
channel_refreshed_update: db.prepare(
"UPDATE Channels SET refreshed = ? WHERE ucid = ?"
)
}
@ -70,6 +73,8 @@ function refreshChannel(ucid) {
// store
prepared.video_insert.run(video)
})
// update channel refreshed
prepared.channel_refreshed_update.run(Date.now(), ucid)
console.log(`updated ${root.length} videos for channel ${ucid}`)
} else if (root.identifier === "PUBLISHED_DATES_NOT_PROVIDED") {
return [] // nothing we can do. skip this iteration.