Fix missing channel name when falling back to /next-only data

Use extract_text() for author name from videoOwnerRenderer,
which handles both 'simpleText' and 'runs' formats.
This commit is contained in:
Emilien 2026-06-26 17:42:29 +02:00
parent 65e58e083c
commit 9ae7bb4ff6
2 changed files with 3 additions and 2 deletions

View File

@ -311,7 +311,6 @@ def get_video(id, refresh = true, region = nil, force_refresh = false)
begin
video = fetch_video(id, region)
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
@ -320,7 +319,6 @@ def get_video(id, refresh = true, region = nil, force_refresh = false)
else
video = fetch_video(id, 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

View File

@ -470,6 +470,9 @@ If you are the administrator, install Invidious Companion: \
subs_text = author_info["subscriberCountText"]?
.try { |t| t["simpleText"]? || t.dig?("runs", 0, "text") }
.try &.as_s.split(" ", 2)[0]
author ||= extract_text(author_info.dig?("title"))
ucid ||= author_info.dig?("title", "runs", 0, "navigationEndpoint", "browseEndpoint", "browseId").try &.as_s
end
# Return data