Search: Don't error if AuthorId does not exist

This commit is contained in:
Chunky programmer
2023-06-07 16:04:14 -04:00
committed by ChunkyProgrammer
parent 9e8baa3539
commit b5f8b4542a
2 changed files with 28 additions and 12 deletions

View File

@@ -822,9 +822,9 @@ module HelperExtractors
end
# Retrieves the ID required for querying the InnerTube browse endpoint.
# Raises when it's unable to do so
# Returns an empty string when it's unable to do so
def self.get_browse_id(container)
return container.dig("navigationEndpoint", "browseEndpoint", "browseId").as_s
return container.dig?("navigationEndpoint", "browseEndpoint", "browseId").try &.as_s || ""
end
end