Use case statement for trending_type

Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
pull/3622/head
ChunkyProgrammer 2 years ago
parent 28424d0e88
commit 838cbeffcc

@ -4,14 +4,12 @@ def fetch_trending(trending_type, region, locale)
plid = nil plid = nil
trending_type ||= "default" case trending_type.try &.downcase
trending_type = trending_type.downcase when "music"
if trending_type == "music"
params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D" params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D"
elsif trending_type == "gaming" when "gaming"
params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D" params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D"
elsif trending_type == "movies" when "movies"
params = "4gIKGgh0cmFpbGVycw%3D%3D" params = "4gIKGgh0cmFpbGVycw%3D%3D"
else # Default else # Default
params = "" params = ""

Loading…
Cancel
Save