mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
move theme converter function to a separate file
This commit is contained in:
parent
984a4acc7b
commit
080d9a8dc7
2 changed files with 12 additions and 13 deletions
|
@ -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"))
|
||||||
|
|
12
src/invidious/user/converters.cr
Normal file
12
src/invidious/user/converters.cr
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
def convert_theme(theme)
|
||||||
|
case theme
|
||||||
|
when "true"
|
||||||
|
"dark"
|
||||||
|
when "false"
|
||||||
|
"light"
|
||||||
|
when "", nil
|
||||||
|
nil
|
||||||
|
else
|
||||||
|
theme
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue