From 0dbef6ab9fb47d486883f0cb0a28d717b54c5a6f Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 26 Aug 2018 15:00:19 -0500 Subject: [PATCH] Fix typo in preferred_captions --- src/invidious.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index dd2af9e6..ede2dcf6 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -241,7 +241,7 @@ get "/watch" do |env| params[:preferred_captions].includes?(caption.languageCode.split("-")[0]) } preferred_captions.sort_by! { |caption| - (params[:preferred_captions].index(caption.languageCode) || + (params[:preferred_captions].index(caption.name.simpleText) || params[:preferred_captions].index(caption.languageCode.split("-")[0])).not_nil! } captions = captions - preferred_captions @@ -341,7 +341,7 @@ get "/embed/:id" do |env| params[:preferred_captions].includes?(caption.languageCode.split("-")[0]) } preferred_captions.sort_by! { |caption| - (params[:preferred_captions].index(caption.languageCode) || + (params[:preferred_captions].index(caption.name.simpleText) || params[:preferred_captions].index(caption.languageCode.split("-")[0])).not_nil! } captions = captions - preferred_captions