From b51770dbdbdcca04d04849d37e5f11ce20948c73 Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sat, 16 Nov 2024 23:00:48 +0100 Subject: [PATCH] fix linting + use .empty? --- src/invidious/config.cr | 2 +- src/invidious/videos/parser.cr | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 29f4b60c..4b06ff83 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -257,7 +257,7 @@ class Config puts "Config: You can not run inv_sig_helper and invidious_companion at the same time." exit(1) end - if !CONFIG.invidious_companion_key + if CONFIG.invidious_companion_key.empty? puts "Config: Please configure a key if you are using invidious companion." exit(1) elsif CONFIG.invidious_companion_key == "CHANGE_ME!!" diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 7a73be68..4d0e0378 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -120,9 +120,9 @@ def extract_video_info(video_id : String) new_player_response["storyboards"] = player_response["storyboards"] if player_response["storyboards"]? new_player_response["captions"] = player_response["captions"] if player_response["captions"]? - player_response = new_player_response - params.delete("reason") - end + player_response = new_player_response + params.delete("reason") + end end {"captions", "playabilityStatus", "playerConfig", "storyboards", "invidiousCompanion"}.each do |f|