From fd84b57ac8467992b23678aae9f7af04be8050de Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 25 Mar 2019 10:00:18 -0500 Subject: [PATCH] Use tuples for "qualities" in API endpoints --- src/invidious.cr | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index f1494ac5..65a81f79 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2847,7 +2847,7 @@ get "/api/v1/videos/:id" do |env| json.field "authorThumbnails" do json.array do - qualities = [32, 48, 76, 100, 176, 512] + qualities = {32, 48, 76, 100, 176, 512} qualities.each do |quality| json.object do @@ -3211,9 +3211,11 @@ get "/api/v1/channels/:ucid" do |env| json.field "authorBanners" do json.array do - qualities = [{width: 2560, height: 424}, - {width: 2120, height: 351}, - {width: 1060, height: 175}] + qualities = { + {width: 2560, height: 424}, + {width: 2120, height: 351}, + {width: 1060, height: 175}, + } qualities.each do |quality| json.object do json.field "url", banner.gsub("=w1060", "=w#{quality[:width]}") @@ -3232,7 +3234,7 @@ get "/api/v1/channels/:ucid" do |env| json.field "authorThumbnails" do json.array do - qualities = [32, 48, 76, 100, 176, 512] + qualities = {32, 48, 76, 100, 176, 512} qualities.each do |quality| json.object do @@ -3302,7 +3304,7 @@ get "/api/v1/channels/:ucid" do |env| json.field "authorThumbnails" do json.array do - qualities = [32, 48, 76, 100, 176, 512] + qualities = {32, 48, 76, 100, 176, 512} qualities.each do |quality| json.object do @@ -3582,7 +3584,7 @@ get "/api/v1/channels/search/:ucid" do |env| json.field "authorThumbnails" do json.array do - qualities = [32, 48, 76, 100, 176, 512] + qualities = {32, 48, 76, 100, 176, 512} qualities.each do |quality| json.object do @@ -3707,7 +3709,7 @@ get "/api/v1/search" do |env| json.field "authorThumbnails" do json.array do - qualities = [32, 48, 76, 100, 176, 512] + qualities = {32, 48, 76, 100, 176, 512} qualities.each do |quality| json.object do @@ -3775,7 +3777,7 @@ get "/api/v1/playlists/:plid" do |env| json.field "authorThumbnails" do json.array do - qualities = [32, 48, 76, 100, 176, 512] + qualities = {32, 48, 76, 100, 176, 512} qualities.each do |quality| json.object do