Skip to content

Commit 686c978

Browse files
Simplify HideSkipPromptAt code
1 parent b2f3168 commit 686c978

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,11 @@ public ActionResult<Dictionary<AnalysisMode, Intro>> GetSkippableSegments([FromR
8888

8989
var config = Plugin.Instance!.Configuration;
9090
segment.ShowSkipPromptAt = Math.Max(0, segment.IntroStart - config.ShowPromptAdjustment);
91-
segment.HideSkipPromptAt = segment.IntroStart + config.HidePromptAdjustment;
91+
segment.HideSkipPromptAt = Math.Min(
92+
segment.IntroStart + config.HidePromptAdjustment,
93+
segment.IntroEnd);
9294
segment.IntroEnd -= config.SecondsOfIntroToPlay;
9395

94-
// Don't show prompt after the segment has ended
95-
if (segment.HideSkipPromptAt > segment.IntroEnd)
96-
{
97-
segment.HideSkipPromptAt = segment.IntroEnd;
98-
}
99-
10096
return segment;
10197
}
10298
catch (KeyNotFoundException)

0 commit comments

Comments
 (0)