chore: remove unused code
Some checks failed
Invidious CI / build (push) Has been cancelled

This commit is contained in:
Fijxu 2025-01-13 11:10:54 -03:00
parent 61106da689
commit b0141d87fa
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 0 additions and 30 deletions

View file

@ -4,22 +4,11 @@ module Invidious::Database::Videos
extend self extend self
def insert(video : Video) 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, video.info.to_json, ex: 14400)
REDIS_DB.set(video.id + ":time", video.updated, ex: 14400) REDIS_DB.set(video.id + ":time", video.updated, ex: 14400)
end end
def delete(id) def delete(id)
request = <<-SQL
DELETE FROM videos *
WHERE id = $1
SQL
REDIS_DB.del(id) REDIS_DB.del(id)
REDIS_DB.del(id + ":time") REDIS_DB.del(id + ":time")
end end
@ -44,11 +33,6 @@ module Invidious::Database::Videos
end end
def select(id : String) : Video? 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"))) if ((info = REDIS_DB.get(id)) && (time = REDIS_DB.get(id + ":time")))
return Video.new({ return Video.new({
id: id, id: id,

View file

@ -384,20 +384,6 @@ def parse_link_endpoint(endpoint : JSON::Any, text : String, video_id : String)
return text return text
end 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) def encrypt_ecb_without_salt(data, key)
cipher = OpenSSL::Cipher.new("aes-128-ecb") cipher = OpenSSL::Cipher.new("aes-128-ecb")
cipher.encrypt cipher.encrypt