summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>2023-02-11 08:41:26 -0500
committerChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>2023-02-11 08:45:57 -0500
commit838cbeffcc7c8f85c83f6ab3e97362f803bd766c (patch)
tree5e5dacfb9754498d85f520a3cb9d34dee9f348df /src
parent28424d0e881c8595bbc5797b9ef46e98103fe6d6 (diff)
downloadinvidious-838cbeffcc7c8f85c83f6ab3e97362f803bd766c.tar.gz
invidious-838cbeffcc7c8f85c83f6ab3e97362f803bd766c.tar.bz2
invidious-838cbeffcc7c8f85c83f6ab3e97362f803bd766c.zip
Use case statement for trending_type
Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
Diffstat (limited to 'src')
-rw-r--r--src/invidious/trending.cr10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/invidious/trending.cr b/src/invidious/trending.cr
index d164c37f..134eb437 100644
--- a/src/invidious/trending.cr
+++ b/src/invidious/trending.cr
@@ -4,14 +4,12 @@ def fetch_trending(trending_type, region, locale)
plid = nil
- trending_type ||= "default"
- trending_type = trending_type.downcase
-
- if trending_type == "music"
+ case trending_type.try &.downcase
+ when "music"
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
- elsif trending_type == "gaming"
+ when "gaming"
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
- elsif trending_type == "movies"
+ when "movies"
params = "4gIKGgh0cmFpbGVycw%3D%3D"
else # Default
params = ""