mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2026-03-02 02:31:35 +00:00
Keep subscriptions in database if channel deleted
This commit is contained in:
parent
deea909585
commit
0aa0505009
4 changed files with 13 additions and 5 deletions
|
|
@ -51,7 +51,7 @@ class User {
|
|||
|
||||
getSubscriptions() {
|
||||
if (this.token) {
|
||||
return db.prepare("SELECT ucid FROM Subscriptions WHERE token = ?").pluck().all(this.token)
|
||||
return db.prepare("SELECT ucid FROM Subscriptions WHERE token = ? AND channel_missing = 0").pluck().all(this.token)
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ class User {
|
|||
|
||||
isSubscribed(ucid) {
|
||||
if (this.token) {
|
||||
return !!db.prepare("SELECT * FROM Subscriptions WHERE token = ? AND ucid = ?").get([this.token, ucid])
|
||||
return !!db.prepare("SELECT * FROM Subscriptions WHERE token = ? AND ucid = ? AND channel_missing = 0").get([this.token, ucid])
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ const deltas = [
|
|||
function() {
|
||||
db.prepare("ALTER TABLE Settings ADD COLUMN recommended_mode INTEGER DEFAULT 0")
|
||||
.run()
|
||||
},
|
||||
// 8: Subscriptions +channel_missing
|
||||
function() {
|
||||
db.prepare("ALTER TABLE Subscriptions ADD COLUMN channel_missing INTEGER DEFAULT 0")
|
||||
.run()
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue