Skip to content

Commit

Permalink
fix: use name_short for anki deckname
Browse files Browse the repository at this point in the history
  • Loading branch information
bpevs committed Nov 26, 2023
1 parent 8f1b38c commit 918c3f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/gen_anki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ listLanguages().forEach(async (langCode: string) => {
if (hasAudioDir) req.push([0, 'all', [0]])

const model = new Model({
name: `Emoji Flashcards (${lang.name_short || lang.name})`,
name: `Emoji Flashcards (${lang.name})`,
id: lang.meta.anki_id,
did: lang.meta.anki_id,
flds: fields,
Expand All @@ -45,7 +45,7 @@ listLanguages().forEach(async (langCode: string) => {

const deck = new Deck(
lang.meta.anki_id,
`${lang.name} ${lang.locale_flag} - Emoji Flashcards`,
`${lang.name_short || lang.name} ${lang.locale_flag} - Emoji Flashcards`,
)
const pkg = new Package()

Expand Down
4 changes: 2 additions & 2 deletions utilities/genanki/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class Package {
this.media.push({ name, data })
}

async writeToFile(filename: string) {
async writeToFile(filepath: string) {
const SQL = await initSqlJs()

const db = new SQL.Database()
Expand Down Expand Up @@ -139,7 +139,7 @@ export class Package {
} = { type: 'blob', mimeType: 'application/apkg' }
const blob = await zip.generateAsync(props)
const zipBuffer = await blob.arrayBuffer()
await Deno.writeFile(filename, new Uint8Array(zipBuffer))
await Deno.writeFile(filepath, new Uint8Array(zipBuffer))
}

// deno-lint-ignore no-explicit-any
Expand Down

0 comments on commit 918c3f5

Please sign in to comment.