From deb1187ea9926d7bdc5c003edaae119be674b1f1 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sat, 19 Apr 2025 20:56:14 -0400 Subject: [PATCH] feat: option to increase the number of videos shown on the popular page --- src/invidious/config.cr | 3 +++ src/invidious/database/channels.cr | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 429ec452..b7a5f78a 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -52,6 +52,7 @@ struct ConfigPreferences property vr_mode : Bool = true property show_nick : Bool = true property save_player_pos : Bool = false + property enable_dearrow : Bool = false def to_tuple {% begin %} @@ -241,6 +242,8 @@ class Config property disable_livestreams : Bool = true + property max_popuplar_results : Int32 = 40 + {% if flag?(:linux) %} property reload_config_automatically : Bool = true {% end %} diff --git a/src/invidious/database/channels.cr b/src/invidious/database/channels.cr index df44e485..fd001868 100644 --- a/src/invidious/database/channels.cr +++ b/src/invidious/database/channels.cr @@ -149,7 +149,7 @@ module Invidious::Database::ChannelVideos SELECT DISTINCT ON (ucid) * FROM channel_videos WHERE ucid IN (SELECT channel FROM (SELECT UNNEST(subscriptions) AS channel FROM users) AS d - GROUP BY channel ORDER BY COUNT(channel) DESC LIMIT 40) + GROUP BY channel ORDER BY COUNT(channel) DESC LIMIT #{CONFIG.max_popuplar_results}) ORDER BY ucid, published DESC SQL