diff --git a/apps/sneaker/script.js b/apps/sneaker/script.js index ef755452..90799b3b 100644 --- a/apps/sneaker/script.js +++ b/apps/sneaker/script.js @@ -118,17 +118,23 @@ class TfSneakerAppElement extends LitElement { zip.file(`message/classic/${this.sanitize(id)}.ndjson`, all_messages); let blobs = await tfrpc.rpc.query( - `SELECT blobs.id + `SELECT messages_refs.ref AS id FROM messages JOIN messages_refs ON messages.id = messages_refs.message - JOIN blobs ON messages_refs.ref = blobs.id - WHERE messages.author = ?`, + WHERE messages.author = ? AND messages_refs.ref LIKE '&%.sha256'`, [id]); let blobs_done = 0; for (let row of blobs) { this.progress = {name: 'blobs', value: blobs_done, max: blobs.length}; - let blob = await tfrpc.rpc.get_blob(row.id); - zip.file(`blob/classic/${this.sanitize(row.id)}${this.guess_ext(blob)}`, new Uint8Array(blob)); + let blob; + try { + blob = await tfrpc.rpc.get_blob(row.id); + } catch (e) { + console.log(`Failed to get ${row.id}: ${e.message}`); + } + if (blob) { + zip.file(`blob/classic/${this.sanitize(row.id)}${this.guess_ext(blob)}`, new Uint8Array(blob)); + } blobs_done++; }