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
|
|
@ -24,7 +24,10 @@ module.exports = [
|
|||
|
||||
if (add) {
|
||||
await fetchChannel(ucid, settings.instance)
|
||||
db.prepare("INSERT OR IGNORE INTO Subscriptions (token, ucid) VALUES (?, ?)").run(token, ucid)
|
||||
db.prepare(
|
||||
"INSERT INTO Subscriptions (token, ucid) VALUES (?, ?)"
|
||||
+ " ON CONFLICT (token, ucid) DO UPDATE SET channel_missing = 0"
|
||||
).run(token, ucid)
|
||||
} else {
|
||||
db.prepare("DELETE FROM Subscriptions WHERE token = ? AND ucid = ?").run(token, ucid)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue