Skip to content

Commit

Permalink
fix: skip empty decks
Browse files Browse the repository at this point in the history
It's causing a lot of noise for big uploads.

Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
  • Loading branch information
aalemayhu committed Dec 27, 2024
1 parent e3d2d78 commit 23fd74d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/storage/jobs/ConversionJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ export default class ConversionJob {
id: string,
owner: string
) => {
exporter.configure(decks);
// Filter out decks with no cards
const filteredDecks = decks.filter(
(deck) => deck.cards && deck.cards.length > 0
);

exporter.configure(filteredDecks);
const gen = new CardGenerator(ws.location);
const payload = (await gen.run()) as string;
const apkg = fs.readFileSync(payload);
Expand Down

0 comments on commit 23fd74d

Please sign in to comment.