mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-27 15:30:35 +05:30
moved comments
This commit is contained in:
parent
6816ded0fa
commit
afb0aad7d3
@ -46,13 +46,13 @@ module Invidious::Routes::Misc
|
|||||||
if instance_list.empty?
|
if instance_list.empty?
|
||||||
instance_url = redirect_url
|
instance_url = redirect_url
|
||||||
else
|
else
|
||||||
# Sample returns an array
|
|
||||||
# Instances are packaged as {region, domain} in the instance list
|
|
||||||
# Filter out the current instance
|
# Filter out the current instance
|
||||||
other_available_instances = instance_list.reject! { |region, domain| domain == CONFIG.domain }
|
other_available_instances = instance_list.reject! { |region, domain| domain == CONFIG.domain }
|
||||||
|
|
||||||
# If there are any other instances, select a random one
|
# If there are any other instances, select a random one
|
||||||
if other_available_instances.any?
|
if other_available_instances.any?
|
||||||
|
# Sample returns an array
|
||||||
|
# Instances are packaged as {region, domain} in the instance list
|
||||||
instance_url = other_available_instances.sample(1)[0][1]
|
instance_url = other_available_instances.sample(1)[0][1]
|
||||||
else
|
else
|
||||||
# If the current instance is the only one, use the redirect URL as fallback
|
# If the current instance is the only one, use the redirect URL as fallback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user