From fcc04ef376fa77e4ec9d263262aa9989755aba7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 16 Aug 2023 19:49:21 -0400 Subject: [PATCH] use same settings for spiders --- src/user/settings.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/user/settings.js b/src/user/settings.js index 6f560e58f7..9d8c92fdc3 100644 --- a/src/user/settings.js +++ b/src/user/settings.js @@ -10,11 +10,16 @@ const notifications = require('../notifications'); const languages = require('../languages'); module.exports = function (User) { + const spiderDefaultSettings = { + usePagination: 1, + topicPostSort: 'oldest_to_newest', + postsPerPage: 20, + topicsPerPage: 20, + }; User.getSettings = async function (uid) { if (parseInt(uid, 10) <= 0) { - return await onSettingsLoaded(uid, { - usePagination: parseInt(uid, 10) === -1 ? 1 : undefined, // force spiders to use pagination - }); + const isSpider = parseInt(uid, 10) === -1; + return await onSettingsLoaded(uid, isSpider ? spiderDefaultSettings : {}); } let settings = await db.getObject(`user:${uid}:settings`); settings = settings || {};