move theme converter function to a separate file

pull/2477/head
Samantaz Fox 3 years ago
parent 984a4acc7b
commit 080d9a8dc7
No known key found for this signature in database
GPG Key ID: F42821059186176E

@ -397,19 +397,6 @@ def parse_range(range)
return 0_i64, nil return 0_i64, nil
end end
def convert_theme(theme)
case theme
when "true"
"dark"
when "false"
"light"
when "", nil
nil
else
theme
end
end
def fetch_random_instance def fetch_random_instance
begin begin
instance_api_client = make_client(URI.parse("https://api.invidious.io")) instance_api_client = make_client(URI.parse("https://api.invidious.io"))

@ -0,0 +1,12 @@
def convert_theme(theme)
case theme
when "true"
"dark"
when "false"
"light"
when "", nil
nil
else
theme
end
end
Loading…
Cancel
Save