Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/core/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ export default class TorrentClient extends WebTorrent {
for (const file of Object.values(map)) {
const data = await file.arrayBuffer()
if (targetFile !== this.currentFile) return
this.dispatch('file', { data: new Uint8Array(data) }, [data])
// the renderer reads this as a binary string, same as embedded attachments send
this.dispatch('file', hex2bin(arr2hex(new Uint8Array(data))))
}
}

Expand Down
2 changes: 2 additions & 0 deletions common/modules/subtitles.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default class Subtitles {
this.handleFile = (detail) => {
if (this.selected) {
const uint8 = hex2arr(bin2hex(detail))
// an empty font throw away.
if (!uint8.length) return console.warn('Discarded an empty font, subtitles may render with a fallback typeface.')
this.fonts.push(uint8)
this.renderer?.addFont(uint8)
}
Expand Down
Loading