From 1ceb827a82b4e36496d5ab1a3d73c9f487f93413 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 18 Feb 2019 15:44:15 -0600 Subject: [PATCH] Check deleted channels --- src/invidious/jobs.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/jobs.cr b/src/invidious/jobs.cr index 04816efd..52bf143d 100644 --- a/src/invidious/jobs.cr +++ b/src/invidious/jobs.cr @@ -55,7 +55,7 @@ def refresh_channels(db, logger, max_threads = 1, full_refresh = false) active_channel = Channel(Bool).new loop do - db.query("SELECT id FROM channels WHERE deleted = false ORDER BY updated") do |rs| + db.query("SELECT id FROM channels ORDER BY updated") do |rs| rs.each do id = rs.read(String) @@ -71,7 +71,7 @@ def refresh_channels(db, logger, max_threads = 1, full_refresh = false) client = make_client(YT_URL) channel = fetch_channel(id, client, db, full_refresh) - db.exec("UPDATE channels SET updated = $1, author = $2 WHERE id = $3", Time.now, channel.author, id) + db.exec("UPDATE channels SET updated = $1, author = $2, deleted = false WHERE id = $3", Time.now, channel.author, id) rescue ex if ex.message == "Deleted or invalid channel" db.exec("UPDATE channels SET deleted = true WHERE id = $1", id)