From 36063d1f334c9e7af53014f3d3053600ea980e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 3 Feb 2025 12:47:45 -0500 Subject: [PATCH] fix: path on windows, #13119 --- src/topics/thumbs.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js index 3a47033afc..5e7b5248b0 100644 --- a/src/topics/thumbs.js +++ b/src/topics/thumbs.js @@ -71,9 +71,10 @@ Thumbs.get = async function (tids, options) { if (!options.thumbsOnly) { // Add uploaded media to thumb sets - const mainPidUploads = await Promise.all(mainPids.map(async pid => await posts.uploads.list(pid))); + const mainPidUploads = await Promise.all(mainPids.map(posts.uploads.list)); mainPidUploads.forEach((uploads, idx) => { - uploads = uploads.map(path => `/${path}`); + uploads = uploads.map(upath => path.join(path.sep, `${upath}`)); + uploads = uploads.filter((upload) => { const type = mime.getType(upload); return !thumbs[idx].includes(upload) && type && type.startsWith('image/');