|
|
@ -98,6 +98,10 @@ module.exports = function (Posts) {
|
|
|
|
let files = await fs.readdir(_getFullPath('/files'));
|
|
|
|
let files = await fs.readdir(_getFullPath('/files'));
|
|
|
|
files = files.filter(filename => filename !== '.gitignore');
|
|
|
|
files = files.filter(filename => filename !== '.gitignore');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Exclude non-timestamped files (e.g. group covers; see gh#10783/gh#10705)
|
|
|
|
|
|
|
|
const tsPrefix = /^\d{13}\-/;
|
|
|
|
|
|
|
|
files = files.filter(filename => tsPrefix.test(filename));
|
|
|
|
|
|
|
|
|
|
|
|
files = await Promise.all(files.map(async filename => (await Posts.uploads.isOrphan(`files/${filename}`) ? `files/${filename}` : null)));
|
|
|
|
files = await Promise.all(files.map(async filename => (await Posts.uploads.isOrphan(`files/${filename}`) ? `files/${filename}` : null)));
|
|
|
|
files = files.filter(Boolean);
|
|
|
|
files = files.filter(Boolean);
|
|
|
|
|
|
|
|
|
|
|
|