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:
parent
643f1e0889
commit
2e69dfc4b7
16 changed files with 53 additions and 619 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue