diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2021-10-07 21:55:21 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2021-10-11 18:33:36 +0200 |
| commit | 080d9a8dc72a1d932dcda07bb93d21fdcc98496a (patch) | |
| tree | fd3457e43cb9f88391a491e9fd4c9658ab0b85c6 /src | |
| parent | 984a4acc7bc629d8da6e43507a4880c43a4b4ec4 (diff) | |
| download | invidious-080d9a8dc72a1d932dcda07bb93d21fdcc98496a.tar.gz invidious-080d9a8dc72a1d932dcda07bb93d21fdcc98496a.tar.bz2 invidious-080d9a8dc72a1d932dcda07bb93d21fdcc98496a.zip | |
move theme converter function to a separate file
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/helpers/utils.cr | 13 | ||||
| -rw-r--r-- | src/invidious/user/converters.cr | 12 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index 68ba76f9..af5f553b 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -397,19 +397,6 @@ def parse_range(range) return 0_i64, nil end -def convert_theme(theme) - case theme - when "true" - "dark" - when "false" - "light" - when "", nil - nil - else - theme - end -end - def fetch_random_instance begin instance_api_client = make_client(URI.parse("https://api.invidious.io")) diff --git a/src/invidious/user/converters.cr b/src/invidious/user/converters.cr new file mode 100644 index 00000000..dcbf8c53 --- /dev/null +++ b/src/invidious/user/converters.cr @@ -0,0 +1,12 @@ +def convert_theme(theme) + case theme + when "true" + "dark" + when "false" + "light" + when "", nil + nil + else + theme + end +end |
