This commit is contained in:
Vito0912 2025-04-26 17:46:19 +02:00
parent 812cb5a160
commit a1d549a2b1
No known key found for this signature in database
GPG Key ID: 29A3D509FE70B237

View File

@ -216,9 +216,12 @@ class FeedEpisode extends Model {
*/ */
static async createFromBooks(books, feed, slug, transaction) { static async createFromBooks(books, feed, slug, transaction) {
// This is never null unless the books array is empty, as this method is not invoked when no books. Reduce needs an initial item // This is never null unless the books array is empty, as this method is not invoked when no books. Reduce needs an initial item
const earliestLibraryItemCreatedAt = books.length > 0 ? books.reduce((earliest, book) => { const earliestLibraryItemCreatedAt =
books.length > 0
? books.reduce((earliest, book) => {
return book.libraryItem.createdAt < earliest.libraryItem.createdAt ? book : earliest return book.libraryItem.createdAt < earliest.libraryItem.createdAt ? book : earliest
}).libraryItem.createdAt : null }).libraryItem.createdAt
: null
const feedEpisodeObjs = [] const feedEpisodeObjs = []
let numExisting = 0 let numExisting = 0