Skip to content

Commit

Permalink
Save subtitles also to the Redis media storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-karatsiuba committed Apr 10, 2023
1 parent e41062e commit ecca00a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/util/saveArticles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,10 @@ async function saveArticle(
try {
const { finalHTML, mediaDependencies, subtitles } = await processArticleHtml(articleHtml, redisStore, mw, dump, articleId, articleDetail, _moduleDependencies, downloader.webp)

const filesToDownload: KVS<FileDetail> = {}
const mediaToDownload: KVS<FileDetail> = {}

subtitles.forEach((s) => {
filesToDownload[s.path] = { url: s.url, namespace: '-' }
mediaToDownload[s.path] = { url: s.url, namespace: '-' }
})

if (mediaDependencies.length) {
Expand All @@ -218,7 +217,6 @@ async function saveArticle(
}

await redisStore.mediaToDownloadXPath.setMany(mediaToDownload)
await redisStore.filesToDownloadXPath.setMany(filesToDownload)

const zimArticle = new ZimArticle({
url: articleId,
Expand Down

0 comments on commit ecca00a

Please sign in to comment.