Skip to content

Commit d1f5e65

Browse files
committed
try ensure stat
1 parent ff3a54e commit d1f5e65

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/modules/games/files.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,19 @@ export class FilesService implements OnApplicationBootstrap {
610610
type: "files",
611611
depth: configuration.GAMES.SEARCH_RECURSIVE ? undefined : 0,
612612
fileFilter: (entry) => this.isValidFilePath(entry.basename),
613+
alwaysStat: true, // ensure size is available for integrity checks
613614
});
614615

615616
const files: File[] = [];
616617
for await (const entry of entries) {
618+
if (!entry.stats) {
619+
this.logger.warn({
620+
message: "Skipping file without stats during indexing.",
621+
path: entry.fullPath,
622+
});
623+
continue;
624+
}
625+
617626
files.push({
618627
path: entry.fullPath,
619628
size: BigInt(entry.stats.size),

0 commit comments

Comments
 (0)