From db9d882c2567fba197754a1f6fd1d75114d33560 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Tue, 24 May 2022 15:56:23 +0200
Subject: Add ability to set default feed items count

---
 server/initializers/config.ts    | 8 ++++++++
 server/initializers/constants.ts | 7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)

(limited to 'server/initializers')

diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 2f59e3e3e..c76a839bc 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -247,6 +247,14 @@ const CONFIG = {
       }
     }
   },
+  FEEDS: {
+    VIDEOS: {
+      COUNT: config.get<number>('feeds.videos.count')
+    },
+    COMMENTS: {
+      COUNT: config.get<number>('feeds.comments.count')
+    }
+  },
   ADMIN: {
     get EMAIL () { return config.get<string>('admin.email') }
   },
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 231b86821..824a30bd2 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -766,12 +766,6 @@ const CUSTOM_HTML_TAG_COMMENTS = {
   SERVER_CONFIG: '<!-- server config -->'
 }
 
-// ---------------------------------------------------------------------------
-
-const FEEDS = {
-  COUNT: 20
-}
-
 const MAX_LOGS_OUTPUT_CHARACTERS = 10 * 1000 * 1000
 const LOG_FILENAME = 'peertube.log'
 const AUDIT_LOG_FILENAME = 'peertube-audit.log'
@@ -939,7 +933,6 @@ export {
   ROUTE_CACHE_LIFETIME,
   SORTABLE_COLUMNS,
   HLS_STREAMING_PLAYLIST_DIRECTORY,
-  FEEDS,
   JOB_TTL,
   DEFAULT_THEME_NAME,
   NSFW_POLICY_TYPES,
-- 
cgit v1.2.3