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

@ -28,6 +28,10 @@ let constants = {
recommended_mode: {
type: "integer",
default: 0
},
show_shorts: {
type: "boolean",
default: false
}
},
@ -49,7 +53,9 @@ let constants = {
caching: {
csrf_time: 4*60*60*1000,
seen_token_subscriptions_eligible: 40*60*60*1000,
video_thumbnail_scan_eligible: 90*24*60*60*1000,
subscriptions_refresh_loop_min: 5*60*1000,
video_thumbnail_scan_loop_min: 2*60*60*1000,
subscriptions_refesh_fake_not_found_cooldown: 10*60*1000,
},

View file

@ -34,7 +34,7 @@ class User {
this.token = token
}
/** @return {{instance?: string, save_history?: boolean, local?: boolean, quality?: number}} */
/** @return {{instance?: string, save_history?: boolean, show_shorts?: boolean, local?: number, quality?: number}} */
getSettings() {
if (this.token) {
return db.prepare("SELECT * FROM Settings WHERE token = ?").get(this.token) || {}
@ -43,7 +43,7 @@ class User {
}
}
/** @return {{instance?: string, save_history?: boolean, local?: boolean, quality?: number}} */
/** @return {{instance?: string, save_history?: boolean, show_shorts?: boolean, local?: number, quality?: number}} */
getSettingsOrDefaults() {
const settings = this.getSettings()
for (const key of Object.keys(constants.user_settings)) {

View file

@ -95,6 +95,13 @@ const deltas = [
db.prepare("ALTER TABLE NEW_Subscriptions RENAME TO Subscriptions")
.run()
})()
},
// 13: Videos +short
function() {
db.prepare("ALTER TABLE Videos ADD COLUMN short INTEGER")
.run()
db.prepare("ALTER TABLE Settings ADD COLUMN show_shorts INTEGER NOT NULL DEFAULT 0")
.run()
}
]