From 65e58e083cca471768afbee1fde17e3d572444f7 Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:35:10 +0200 Subject: [PATCH] Skip caching entirely when Invidious Companion is not configured When companion is absent, videos are always fetched fresh since they lack streaming data. Caching is only enabled when companion is present. --- src/invidious/videos.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 527730b3..e843e3e5 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -310,7 +310,8 @@ def get_video(id, refresh = true, region = nil, force_refresh = false) video.schema_version != Video::SCHEMA_VERSION # cache control begin video = fetch_video(id, region) - Invidious::Database::Videos.update(video) + Invidious::Database::Videos.update(video) if CONFIG.invidious_companion.present? +>>>>>>> 465a2cc6 (Skip caching entirely when Invidious Companion is not configured) rescue ex Invidious::Database::Videos.delete(id) raise ex @@ -318,7 +319,8 @@ def get_video(id, refresh = true, region = nil, force_refresh = false) end else video = fetch_video(id, region) - Invidious::Database::Videos.insert(video) if !region + Invidious::Database::Videos.insert(video) if !region && CONFIG.invidious_companion.present? +>>>>>>> 465a2cc6 (Skip caching entirely when Invidious Companion is not configured) end return video