mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #3739 from omnivore-app/fix/youtube-queue
Only check for summaries if the updated entity is a page item
This commit is contained in:
commit
82168fe439
2 changed files with 26 additions and 20 deletions
|
|
@ -360,7 +360,7 @@ export const processYouTubeVideo = async (
|
|||
const videoId = videoURL.searchParams.get('v')
|
||||
|
||||
if (!videoId) {
|
||||
logger.warn('no video id for supplied youtube url', {
|
||||
logger.warning('no video id for supplied youtube url', {
|
||||
url: libraryItem.originalUrl,
|
||||
})
|
||||
return
|
||||
|
|
@ -370,7 +370,7 @@ export const processYouTubeVideo = async (
|
|||
const youtube = new YouTubeClient()
|
||||
const video = await youtube.getVideo(videoId)
|
||||
if (!video) {
|
||||
logger.warn('no video found for youtube url', {
|
||||
logger.warning('no video found for youtube url', {
|
||||
url: libraryItem.originalUrl,
|
||||
})
|
||||
return
|
||||
|
|
@ -427,11 +427,15 @@ export const processYouTubeVideo = async (
|
|||
jobData.userId
|
||||
)
|
||||
if (!updated) {
|
||||
logger.warn('could not updated library item')
|
||||
logger.warning('could not updated library item')
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
logger.warn('error getting youtube metadata: ', { err, jobData, videoURL })
|
||||
logger.warning('error getting youtube metadata: ', {
|
||||
err,
|
||||
jobData,
|
||||
videoURL,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -517,10 +521,10 @@ export const processYouTubeTranscript = async (
|
|||
jobData.userId
|
||||
)
|
||||
if (!updated) {
|
||||
logger.warn('could not updated library item')
|
||||
logger.warning('could not updated library item')
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
logger.warn('error getting youtube transcript: ', { err, jobData })
|
||||
logger.warning('error getting youtube transcript: ', { err, jobData })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,22 +86,24 @@ export const createPubSubClient = (): PubsubClient => {
|
|||
data,
|
||||
})
|
||||
|
||||
if (await findFeatureByName(FeatureName.AISummaries, userId)) {
|
||||
// await enqueueAISummarizeJob({
|
||||
// userId,
|
||||
// libraryItemId,
|
||||
// })
|
||||
}
|
||||
if (type === EntityType.PAGE) {
|
||||
if (await findFeatureByName(FeatureName.AISummaries, userId)) {
|
||||
// await enqueueAISummarizeJob({
|
||||
// userId,
|
||||
// libraryItemId,
|
||||
// })
|
||||
}
|
||||
|
||||
const isYoutubeVideo = (data: any): data is { originalUrl: string } => {
|
||||
return 'originalUrl' in data
|
||||
}
|
||||
const isYoutubeVideo = (data: any): data is { originalUrl: string } => {
|
||||
return 'originalUrl' in data
|
||||
}
|
||||
|
||||
if (isYoutubeVideo(data) && isYouTubeVideoURL(data['originalUrl'])) {
|
||||
await enqueueProcessYouTubeVideo({
|
||||
userId,
|
||||
libraryItemId,
|
||||
})
|
||||
if (isYoutubeVideo(data) && isYouTubeVideoURL(data['originalUrl'])) {
|
||||
await enqueueProcessYouTubeVideo({
|
||||
userId,
|
||||
libraryItemId,
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
entityUpdated: async <T extends Record<string, any>>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue