mirror of
https://github.com/iv-org/invidious.git
synced 2026-07-07 06:06:48 -05:00
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.
This commit is contained in:
parent
77259ad42c
commit
65e58e083c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user