mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 14:37:23 +03:00
Fix bar being too long due to time to decimal changing while remaking bar not true
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user