diff --git a/src/invidious/database/videos.cr b/src/invidious/database/videos.cr index a61e4eec..6b9b4169 100644 --- a/src/invidious/database/videos.cr +++ b/src/invidious/database/videos.cr @@ -4,22 +4,11 @@ module Invidious::Database::Videos extend self def insert(video : Video) - request = <<-SQL - INSERT INTO videos - VALUES ($1, $2, $3) - ON CONFLICT (id) DO NOTHING - SQL - REDIS_DB.set(video.id, video.info.to_json, ex: 14400) REDIS_DB.set(video.id + ":time", video.updated, ex: 14400) end def delete(id) - request = <<-SQL - DELETE FROM videos * - WHERE id = $1 - SQL - REDIS_DB.del(id) REDIS_DB.del(id + ":time") end @@ -44,11 +33,6 @@ module Invidious::Database::Videos end def select(id : String) : Video? - request = <<-SQL - SELECT * FROM videos - WHERE id = $1 - SQL - if ((info = REDIS_DB.get(id)) && (time = REDIS_DB.get(id + ":time"))) return Video.new({ id: id, diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index 5dd12e11..7aacfe7e 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -384,20 +384,6 @@ def parse_link_endpoint(endpoint : JSON::Any, text : String, video_id : String) return text end -# Generates a list of external videoplayback proxies for -# CSP -def gen_videoplayback_proxy_list - if !CONFIG.external_videoplayback_proxy.empty? - external_videoplayback_proxy = "" - CONFIG.external_videoplayback_proxy.each do |proxy| - external_videoplayback_proxy += " #{proxy}" - end - else - external_videoplayback_proxy = "" - end - return external_videoplayback_proxy -end - def encrypt_ecb_without_salt(data, key) cipher = OpenSSL::Cipher.new("aes-128-ecb") cipher.encrypt