mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-18 01:11:30 +00:00
Update updating of end values to use new chaptersToPush temp array
This commit is contained in:
parent
e096a04603
commit
256c341f06
1 changed files with 4 additions and 4 deletions
|
|
@ -141,8 +141,8 @@ class PodcastEpisode extends Model {
|
||||||
|
|
||||||
let chapter = { title: chapterTitleMatch[1].trim(), id: i, start: startTime }
|
let chapter = { title: chapterTitleMatch[1].trim(), id: i, start: startTime }
|
||||||
|
|
||||||
if (podcastEpisode.chapters.length > 0) {
|
if (chaptersToPush.length > 0) {
|
||||||
podcastEpisode.chapters[podcastEpisode.chapters.length - 1].end = startTime
|
chaptersToPush[chaptersToPush.length - 1].end = startTime
|
||||||
}
|
}
|
||||||
|
|
||||||
chaptersToPush.push(chapter)
|
chaptersToPush.push(chapter)
|
||||||
|
|
@ -150,8 +150,8 @@ class PodcastEpisode extends Model {
|
||||||
Logger.debug('Added chapter', chapter)
|
Logger.debug('Added chapter', chapter)
|
||||||
}
|
}
|
||||||
if (errorMessage == null) {
|
if (errorMessage == null) {
|
||||||
if (podcastEpisode.chapters.length > 0) {
|
if (chaptersToPush.length > 0) {
|
||||||
podcastEpisode.chapters[podcastEpisode.chapters.length - 1].end = podcastEpisode.audioFile.duration
|
chaptersToPush[chaptersToPush.length - 1].end = podcastEpisode.audioFile.duration
|
||||||
}
|
}
|
||||||
|
|
||||||
podcastEpisode.chapters.push(...chaptersToPush)
|
podcastEpisode.chapters.push(...chaptersToPush)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue