-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for specifying minimum skip length #169
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…o/iSponsorBlockTV into minimum-skip-length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to implement this but I'm glad that you beat me to it. Just leaving a couple of notes from things that I discovered while looking into it and to point out the changes to config_setup.py from my PR that will be needed.
src/iSponsorBlockTV/config_setup.py
Outdated
# Ask for minimum skip length. Confirm input is an integer | ||
while True: | ||
try: | ||
minimum_skip_length = int( | ||
input("Enter minimum length of segment to skip in seconds: ") | ||
) | ||
break | ||
except ValueError: | ||
print("You entered a non integer value, try again.") | ||
continue | ||
config.minimum_skip_length = minimum_skip_length | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR #150 was merged probably between when you raised this one and now which refactored this script a bit. It should be pretty simple to adapt this to use the get_yn_input
function - though truthfully this is likely fine as is. But you will need to pull the changes for the rest of the script to merge without conflict.
It also might be helpful for the user to include something like "set this to 0 to not skip any segments" or something to that effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, #150 was merged after raising this PR, but refactoring this section of the cli configurator shouldn't be too much work, and ideally a new "panel" would be added to the tui config editor to allow changing this value from there too. I'll be able to do it at some point but if someone wants to go ahead and help you're free to do it. PRs are always appreciated. Thanks for your comment @ryankupk
src/iSponsorBlockTV/helpers.py
Outdated
@@ -41,6 +41,7 @@ def __init__(self, data_dir): | |||
self.skip_count_tracking = True | |||
self.mute_ads = False | |||
self.skip_ads = False | |||
self.minimum_skip_length = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that the minimum ought to be 0 rather than 1, since sponsorblock segments are defined by frames so there could be a segment that's less than 1 second that would be skipped when the user might think that no skipping is happening.
Although one of the configurators will likely always be ran, so the user will define a minimum segment length, I still think that ideally the default would represent no skipping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find 1 to be an appropriate minimum time length, considering that YouTube only allows setting the play head to integer values (so no 10.8 seconds allowed, it'll just round it down to 10). If a user were to want to disable skipping, they should be able to just set the list of skippable categories to an empty one (that should work but it isn't something I've tested)
…o 0 so user has to explicitly enable functionality
for more information, see https://pre-commit.ci
I have merged all changes, updated the setup to match the new format, and set default value of skip length to 0 so a user has to explicitly enable the functoinality |
What's the status on this? It seems to be approved but was never merged? |
Fixes #145
This provides support to specify minimum segment length to skip
I have no chance of updating the graphical configurator and having it work correctly, I hope the utility provided in the rest of this pull request makes up for it