Skip to content

Commit

Permalink
feat(media): use newer media catalog for video images/titles
Browse files Browse the repository at this point in the history
relates to #55
  • Loading branch information
BenShelton committed Jun 23, 2021
1 parent 2d21c24 commit 15706f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/media/app/main/src/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
downloadSongStream,
downloadVideoStream,
emptyDir,
getMediaCatalog,
Publication,
updateCatalog
} from '@library-api/core'
Expand Down Expand Up @@ -126,9 +127,10 @@ export function initIPC (): void {
}))

const baseVideos = await publication.getVideos(args.date)
const mediaCatalog = await getMediaCatalog(DOWNLOAD_DIR, args.languageId)
try {
const videos: IPCVideoDTO[] = await Promise.all(baseVideos.map(async (video) => {
const details = await db.getMediaDetails(video)
const details = mediaCatalog ? await mediaCatalog.getMediaDetails(video) : null
if (!details) {
log.error(`Cannot load details for video: ${video.id}`)
const videoDetails = await placeholderVideoDetails(video)
Expand Down

0 comments on commit 15706f4

Please sign in to comment.