mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
do not update library item score if 0
This commit is contained in:
parent
6bb11ce99b
commit
9f7065c5c3
1 changed files with 12 additions and 14 deletions
|
|
@ -97,24 +97,22 @@ export const scoreLibraryItem = async (
|
|||
items: itemFeatures,
|
||||
})
|
||||
|
||||
logger.info('Scores', scores)
|
||||
const score = scores[libraryItem.id]['score']
|
||||
const score = scores[libraryItem.id].score
|
||||
if (!score) {
|
||||
logger.error('Failed to score library item', data)
|
||||
throw new Error('Failed to score library item')
|
||||
} else {
|
||||
await updateLibraryItem(
|
||||
libraryItem.id,
|
||||
{
|
||||
score,
|
||||
},
|
||||
userId,
|
||||
undefined,
|
||||
true
|
||||
)
|
||||
logger.info('Library item score updated', data)
|
||||
}
|
||||
|
||||
await updateLibraryItem(
|
||||
libraryItem.id,
|
||||
{
|
||||
score,
|
||||
},
|
||||
userId,
|
||||
undefined,
|
||||
true
|
||||
)
|
||||
logger.info('Library item scored', data)
|
||||
|
||||
try {
|
||||
await enqueueUpdateHomeJob({
|
||||
userId,
|
||||
|
|
|
|||
Loading…
Reference in a new issue