Fix bar being too long due to time to decimal changing while remaking bar not true

This commit is contained in:
Ajay
2022-12-11 16:58:40 -05:00
parent 16581d39a4
commit 3e3059d79a

View File

@@ -374,26 +374,24 @@ class PreviewBar {
return; return;
} }
if (remakingBar) { const filteredSegments = segments?.filter((segment) => this.chapterFilter(segment));
const filteredSegments = segments?.filter((segment) => this.chapterFilter(segment)); if (filteredSegments) {
if (filteredSegments) { let groups = this.unfilteredChapterGroups;
let groups = this.unfilteredChapterGroups; if (filteredSegments.length !== segments.length) {
if (filteredSegments.length !== segments.length) { groups = this.createChapterRenderGroups(filteredSegments);
groups = this.createChapterRenderGroups(filteredSegments); }
} this.chapterGroups = groups.filter((segment) => this.chapterGroupFilter(segment));
this.chapterGroups = groups.filter((segment) => this.chapterGroupFilter(segment));
if (groups.length !== this.chapterGroups.length) { if (groups.length !== this.chapterGroups.length) {
// Fix missing sections due to filtered segments // Fix missing sections due to filtered segments
for (let i = 1; i < this.chapterGroups.length; i++) { for (let i = 1; i < this.chapterGroups.length; i++) {
if (this.chapterGroups[i].segment[0] !== this.chapterGroups[i - 1].segment[1]) { if (this.chapterGroups[i].segment[0] !== this.chapterGroups[i - 1].segment[1]) {
this.chapterGroups[i - 1].segment[1] = this.chapterGroups[i].segment[0] this.chapterGroups[i - 1].segment[1] = this.chapterGroups[i].segment[0]
}
} }
} }
} else {
this.chapterGroups = this.unfilteredChapterGroups;
} }
} else {
this.chapterGroups = this.unfilteredChapterGroups;
} }
if (!this.chapterGroups || this.chapterGroups.length <= 0) { if (!this.chapterGroups || this.chapterGroups.length <= 0) {