From a4088023a3bce916faf01547791c6f8b4ba85e2f Mon Sep 17 00:00:00 2001 From: KernelDeimos <7225168+KernelDeimos@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:14:50 -0500 Subject: [PATCH] dev: add parameter to exclude fetching subdomains This parameter will allow readdir requests to not include subdomain fetching, which will allow for the later effort of fetching subdomains for directory listings in the gui with a separate request. --- .../src/filesystem/hl_operations/hl_readdir.js | 11 ++++++----- src/backend/src/routers/filesystem_api/readdir.js | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/backend/src/filesystem/hl_operations/hl_readdir.js b/src/backend/src/filesystem/hl_operations/hl_readdir.js index 020bb484c..81a57921d 100644 --- a/src/backend/src/filesystem/hl_operations/hl_readdir.js +++ b/src/backend/src/filesystem/hl_operations/hl_readdir.js @@ -39,7 +39,7 @@ class HLReadDir extends HLFilesystemOperation { }); } async __run () { - const { subject: subject_let, user, no_thumbs, no_assocs, actor } = this.values; + const { subject: subject_let, user, no_thumbs, no_assocs, no_subdomains, actor } = this.values; let subject = subject_let; if ( ! await subject.exists() ) { @@ -120,10 +120,11 @@ class HLReadDir extends HLFilesystemOperation { } if ( ! no_assocs ) { - await Promise.all([ - this.#batchFetchSuggestedApps(children, user), - this.#batchFetchSubdomains(children, user), - ]); + await this.#batchFetchSuggestedApps(children, user); + } + + if ( ! no_subdomains ) { + await this.#batchFetchSubdomains(children, user); } return Promise.all(children.map(async child => { diff --git a/src/backend/src/routers/filesystem_api/readdir.js b/src/backend/src/routers/filesystem_api/readdir.js index c3b42dda3..ec235c2ef 100644 --- a/src/backend/src/routers/filesystem_api/readdir.js +++ b/src/backend/src/routers/filesystem_api/readdir.js @@ -42,6 +42,7 @@ module.exports = eggspress('/readdir', { recursive: new FlagParam('recursive', { optional: true }), no_thumbs: new FlagParam('no_thumbs', { optional: true }), no_assocs: new FlagParam('no_assocs', { optional: true }), + no_subdomains: new FlagParam('no_subdomains', { optional: true }), }, }, async (req, res, next) => { let log; { @@ -56,6 +57,7 @@ module.exports = eggspress('/readdir', { const recursive = req.values.recursive; const no_thumbs = req.values.no_thumbs; const no_assocs = req.values.no_assocs; + const no_subdomains = req.values.no_subdomains; const hl_readdir = new HLReadDir(); const result = await hl_readdir.run({ @@ -63,6 +65,7 @@ module.exports = eggspress('/readdir', { recursive, no_thumbs, no_assocs, + no_subdomains, user: req.user, actor: req.actor, });