mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-05 15:39:41 +00:00
Compare commits
3 commits
be041f93c2
...
ec05bd36e4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec05bd36e4 | ||
|
|
a1d549a2b1 | ||
|
|
812cb5a160 |
1 changed files with 7 additions and 3 deletions
|
|
@ -215,9 +215,13 @@ class FeedEpisode extends Model {
|
|||
* @returns {Promise<FeedEpisode[]>}
|
||||
*/
|
||||
static async createFromBooks(books, feed, slug, transaction) {
|
||||
const earliestLibraryItemCreatedAt = books.reduce((earliest, book) => {
|
||||
return book.libraryItem.createdAt < earliest.libraryItem.createdAt ? book : earliest
|
||||
}).libraryItem.createdAt
|
||||
// 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) => {
|
||||
return book.libraryItem.createdAt < earliest.libraryItem.createdAt ? book : earliest
|
||||
}).libraryItem.createdAt
|
||||
: null
|
||||
|
||||
const feedEpisodeObjs = []
|
||||
let numExisting = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue