1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-06-01 06:56:48 +00:00

Add shorts identification by thumbnails

This commit is contained in:
Cadence Ember 2026-05-27 22:52:13 +12:00
parent 095dc3f918
commit 21c3f624b0
7 changed files with 235 additions and 5 deletions

View file

@ -1,5 +1,6 @@
const Denque = require("denque")
const constants = require("../utils/constants")
const thumbnailScan = require("./thumbnail-scan")
const db = require("../utils/db")
const prepared = {
@ -81,7 +82,12 @@ class Refresher {
video.descriptionHtml = video.descriptionHtml.replace(/<a /g, '<a tabindex="-1" ') // should be safe
video.viewCountText = null //TODO?
// store
prepared.video_insert.run(video)
const {changes} = prepared.video_insert.run(video)
if (changes === 1) {
// video was newly found, run a thumbnail scan on it
thumbnailScan.scanner.scanQueue.addNext([video.videoId])
thumbnailScan.scanner.skipWaiting()
}
})
// update channel refreshed
prepared.channel_refreshed_update.run(Date.now(), ucid)