mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
save id, url, thumbnail and createdAt in the digest
This commit is contained in:
parent
6bfb4842e2
commit
47fd4d9663
2 changed files with 18 additions and 4 deletions
|
|
@ -365,6 +365,12 @@ export const createDigestJob = async (jobData: CreateDigestJobData) => {
|
|||
urlsToAudio: [],
|
||||
jobState: 'completed',
|
||||
speechFiles,
|
||||
libraryItems: filteredSummaries.map((item) => ({
|
||||
id: item.libraryItem.id,
|
||||
url: item.libraryItem.originalUrl,
|
||||
thumbnail: item.libraryItem.thumbnail ?? undefined,
|
||||
})),
|
||||
createdAt: new Date(),
|
||||
}
|
||||
|
||||
await writeDigest(jobData.userId, digest)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,20 @@ import { redisDataSource } from '../redis_data_source'
|
|||
import { SpeechFile } from '@omnivore/text-to-speech-handler'
|
||||
import { logger } from '../utils/logger'
|
||||
|
||||
interface Chapter {
|
||||
title: string
|
||||
}
|
||||
|
||||
interface LibraryItem {
|
||||
id: string
|
||||
url: string
|
||||
thumbnail?: string
|
||||
}
|
||||
|
||||
export interface Digest {
|
||||
id: string
|
||||
jobState: string
|
||||
createdAt: Date
|
||||
|
||||
url?: string
|
||||
title?: string
|
||||
|
|
@ -13,10 +24,7 @@ export interface Digest {
|
|||
|
||||
urlsToAudio?: string[]
|
||||
speechFiles?: SpeechFile[]
|
||||
}
|
||||
|
||||
interface Chapter {
|
||||
title: string
|
||||
libraryItems?: LibraryItem[]
|
||||
}
|
||||
|
||||
const digestKey = (userId: string) => `digest:${userId}`
|
||||
|
|
|
|||
Loading…
Reference in a new issue