Skip to content

Conversation

@syeopite
Copy link
Member

No description provided.

@syeopite syeopite requested a review from a team as a code owner May 17, 2025 22:55
@syeopite syeopite requested review from Fijxu and removed request for a team May 17, 2025 22:55
params["reason"] = JSON::Any.new(reason) if reason

if !CONFIG.invidious_companion.present?
if player_response["streamingData"]? && player_response.dig?("streamingData", "adaptiveFormats", 0, "url").nil?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be reduced as well

Suggested change
if player_response["streamingData"]? && player_response.dig?("streamingData", "adaptiveFormats", 0, "url").nil?
if player_response.dig?("streamingData", "adaptiveFormats", 0, "url").nil?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, and it's faster ;) :

? &&   3.42M (292.29ns) (± 1.08%)  0.0B/op   1.28× slower
dig?     4.37M (229.07ns) (± 1.05%)  0.0B/op        fastest

@syeopite
Copy link
Member Author

Superceded by #5312

@syeopite syeopite closed this May 18, 2025
@syeopite syeopite deleted the minor-companionless-stream-retrival-optimization branch May 18, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants