mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 09:51:37 +00:00
Compare commits
No commits in common. "ec05bd36e41dbd209d7b31b7b810c6fa38afdb8f" and "be041f93c245a3fd97dbde8f6eabc60e0cae7ed6" have entirely different histories.
ec05bd36e4
...
be041f93c2
1 changed files with 3 additions and 7 deletions
|
|
@ -215,13 +215,9 @@ class FeedEpisode extends Model {
|
||||||
* @returns {Promise<FeedEpisode[]>}
|
* @returns {Promise<FeedEpisode[]>}
|
||||||
*/
|
*/
|
||||||
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
|
const earliestLibraryItemCreatedAt = books.reduce((earliest, book) => {
|
||||||
const earliestLibraryItemCreatedAt =
|
return book.libraryItem.createdAt < earliest.libraryItem.createdAt ? book : earliest
|
||||||
books.length > 0
|
}).libraryItem.createdAt
|
||||||
? books.reduce((earliest, book) => {
|
|
||||||
return book.libraryItem.createdAt < earliest.libraryItem.createdAt ? book : earliest
|
|
||||||
}).libraryItem.createdAt
|
|
||||||
: null
|
|
||||||
|
|
||||||
const feedEpisodeObjs = []
|
const feedEpisodeObjs = []
|
||||||
let numExisting = 0
|
let numExisting = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue