The proposed fix should take care of all kinds of overlapping segments. Even segment "chains" like [startA, startB, endA, startC, endB, endC]. Those should be merged into one big segment as well.
Then the segments will go to the next step sorted by start, so that part will not get confused any more either and will also remove the duplicates created by the first two steps.
Justification: this LTT video https://www.youtube.com/watch?v=t78p50s32HY The API returns overlapping and unsorted segments for it.
Note how the first two segments overlap and also are not in the correct order. This causes this code here https://github.com/dmunozv04/iSponsorBlockTV/blob/a75dd83548421023165f3fe3fe100de995de784d/src/iSponsorBlockTV/api_helpers.py#L172 to get confused and instead of one big segment
[35.5, 55.37]
we end up with one very small segment[37.66, 38.56]
The proposed fix should take care of all kinds of overlapping segments. Even segment "chains" like
[startA, startB, endA, startC, endB, endC]
. Those should be merged into one big segment as well. Then the segments will go to the next step sorted by start, so that part will not get confused any more either and will also remove the duplicates created by the first two steps.