mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Refresh segments when creating new segment to submit
This commit is contained in:
@@ -589,6 +589,7 @@ async function sponsorsLookup(id: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const oldSegments = sponsorTimes;
|
||||||
sponsorTimes = recievedSegments;
|
sponsorTimes = recievedSegments;
|
||||||
|
|
||||||
// Hide all submissions smaller than the minimum duration
|
// Hide all submissions smaller than the minimum duration
|
||||||
@@ -600,6 +601,15 @@ async function sponsorsLookup(id: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const segment of oldSegments) {
|
||||||
|
const otherSegment = sponsorTimes.find((other) => segment.UUID === other.UUID);
|
||||||
|
if (otherSegment) {
|
||||||
|
// If they downvoted it, or changed the category, keep it
|
||||||
|
otherSegment.hidden = segment.hidden;
|
||||||
|
otherSegment.category = segment.category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
startSkipScheduleCheckingForStartSponsors();
|
startSkipScheduleCheckingForStartSponsors();
|
||||||
|
|
||||||
// Reset skip save
|
// Reset skip save
|
||||||
@@ -1181,6 +1191,9 @@ function startOrEndTimingNewSegment() {
|
|||||||
// Save the newly created segment
|
// Save the newly created segment
|
||||||
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
|
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
|
||||||
|
|
||||||
|
// Make sure they know if someone has already submitted something it while they were watching
|
||||||
|
sponsorsLookup(sponsorVideoID);
|
||||||
|
|
||||||
updateEditButtonsOnPlayer();
|
updateEditButtonsOnPlayer();
|
||||||
updateSponsorTimesSubmitting(false);
|
updateSponsorTimesSubmitting(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user