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

Move utils folder and fix published text

This commit is contained in:
Cadence Ember 2020-09-24 00:05:02 +12:00
parent 643f1e0889
commit 2e69dfc4b7
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
16 changed files with 53 additions and 619 deletions

View file

@ -1,14 +1,14 @@
const Denque = require("denque")
const fetch = require("node-fetch")
const constants = require("../api/utils/constants")
const db = require("../api/utils/db")
const constants = require("../utils/constants")
const db = require("../utils/db")
const prepared = {
video_insert: db.prepare(
"INSERT OR IGNORE INTO Videos"
+ " ( videoId, title, author, authorId, published, publishedText, viewCountText, descriptionHtml)"
+ " ( videoId, title, author, authorId, published, viewCountText, descriptionHtml)"
+ " VALUES"
+ " (@videoId, @title, @author, @authorId, @published, @publishedText, @viewCountText, @descriptionHtml)"
+ " (@videoId, @title, @author, @authorId, @published, @viewCountText, @descriptionHtml)"
)
}
@ -48,6 +48,10 @@ class RefreshQueue {
}
next() {
if (this.isEmpty()) {
throw new Error("Cannot get next of empty refresh queue")
}
const item = this.queue.shift()
this.set.delete(item)
return item