Don't show prompt after the segment has ended (#152)

If the user has `HidePromptAdjustment` set to a
value larger then the intro length, the prompt
would be visible after the intro has ended.

Additionally, setting this value to a ridiculously
high number allows user to make the prompt visible
until the end of the segment.
This commit is contained in:
Péter Tombor 2023-06-03 04:53:38 +02:00 committed by GitHub
parent 8f5e283970
commit 8edb8f173c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,6 +91,12 @@ public class SkipIntroController : ControllerBase
segment.HideSkipPromptAt = segment.IntroStart + config.HidePromptAdjustment;
segment.IntroEnd -= config.SecondsOfIntroToPlay;
// Don't show prompt after the segment has ended
if (segment.HideSkipPromptAt > segment.IntroEnd)
{
segment.HideSkipPromptAt = segment.IntroEnd;
}
return segment;
}
catch (KeyNotFoundException)