Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit e1d0c6b

Browse files
committed
fix: prevent files with incorrectly classified fileformat from being downloaded
1 parent 22eefd4 commit e1d0c6b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/helpers/jw-media.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,12 @@ const downloadPubMediaFiles = async (publication: PublicationFetcher) => {
13531353
}
13541354
}
13551355
for (const mediaLink of filteredMediaItemLinks) {
1356+
if (
1357+
!path
1358+
?.extname(mediaLink?.file?.url)
1359+
?.includes(publication?.fileformat?.toLowerCase())
1360+
)
1361+
continue; // This file is not of the right format; API glitch!
13561362
downloadFileIfNeeded({
13571363
dir,
13581364
lowPriority: true,

0 commit comments

Comments
 (0)