From 823f679cef1d9d0547cc0da1e9cd5a191a65a43b Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 31 Mar 2018 16:33:01 -0500 Subject: [PATCH] Add fix for removed videos in subbox --- src/helpers.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers.cr b/src/helpers.cr index 6131989b..9bfa8b19 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -532,6 +532,8 @@ def fetch_channel(id, client, db) rss = client.get("/feeds/videos.xml?channel_id=#{id}").body rss = XML.parse_html(rss) + db.exec("DELETE FROM channel_videos * WHERE ucid = $1", id) + rss.xpath_nodes("//feed/entry").each do |entry| video_id = entry.xpath_node("videoid").not_nil!.content title = entry.xpath_node("title").not_nil!.content