Skip to content

Commit 6ad6cbb

Browse files
committed
fix(play): an address given again, as with its size, does not start the build again (#98)
1 parent 955686a commit 6ad6cbb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/h5p/play/play-page.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,12 @@ function takeLinks(given: Record<string, unknown>, sizes: Record<string, unknown
550550
let added = false
551551
for (const [name, address] of Object.entries(given)) {
552552
if (typeof address !== 'string' || !/^https?:\/\//i.test(address) || !URL.canParse(address) || !playable(name)) continue
553-
links.set(baseName(name), address)
554553
// What the file there weighs, where the parent knows: a download is not begun that cannot be saved.
555554
const size = amount(sizes[name])
556555
if (size !== null) sizeAt.set(address, size)
556+
// The same address again, as with its size once that is known, is nothing new to build with.
557+
if (links.get(baseName(name)) === address) continue
558+
links.set(baseName(name), address)
557559
added = true
558560
}
559561
if (added && !previewed.length && filesFor(wanted).missing.length) void play()

0 commit comments

Comments
 (0)