mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-10 14:06:44 +03:00
Updated setup to match new format. Set default value of skip length to 0 so user has to explicitly enable functionality
This commit is contained in:
committed by
Matthew Stern
parent
c360e2582e
commit
e0c4322524
@@ -12,7 +12,7 @@
|
|||||||
"skip_count_tracking": true,
|
"skip_count_tracking": true,
|
||||||
"mute_ads": true,
|
"mute_ads": true,
|
||||||
"skip_ads": true,
|
"skip_ads": true,
|
||||||
"minimum_skip_length": 1,
|
"minimum_skip_length": 0,
|
||||||
"auto_play": true,
|
"auto_play": true,
|
||||||
"join_name": "iSponsorBlockTV",
|
"join_name": "iSponsorBlockTV",
|
||||||
"apikey": "",
|
"apikey": "",
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ SEARCH_CHANNEL_PROMPT = 'Enter a channel name or "/exit" to exit: '
|
|||||||
SELECT_CHANNEL_PROMPT = "Select one option of the above [0-6]: "
|
SELECT_CHANNEL_PROMPT = "Select one option of the above [0-6]: "
|
||||||
ENTER_CHANNEL_ID_PROMPT = "Enter a channel ID: "
|
ENTER_CHANNEL_ID_PROMPT = "Enter a channel ID: "
|
||||||
ENTER_CUSTOM_CHANNEL_NAME_PROMPT = "Enter the channel name: "
|
ENTER_CUSTOM_CHANNEL_NAME_PROMPT = "Enter the channel name: "
|
||||||
|
MINIMUM_SKIP_PROMPT = "Do you want to specify a minimum length of segment to skip? (y/N)"
|
||||||
|
MINIMUM_SKIP_SPECIFICATION_PROMPT = "Enter minimum length of segment to skip in seconds (enter 0 to disable):"
|
||||||
REPORT_SKIPPED_SEGMENTS_PROMPT = (
|
REPORT_SKIPPED_SEGMENTS_PROMPT = (
|
||||||
"Do you want to report skipped segments to sponsorblock. Only the segment"
|
"Do you want to report skipped segments to sponsorblock. Only the segment"
|
||||||
" UUID will be sent? (Y/n) "
|
" UUID will be sent? (Y/n) "
|
||||||
@@ -183,15 +185,20 @@ def main(config, debug: bool) -> None:
|
|||||||
config.channel_whitelist = channel_whitelist
|
config.channel_whitelist = channel_whitelist
|
||||||
|
|
||||||
# Ask for minimum skip length. Confirm input is an integer
|
# Ask for minimum skip length. Confirm input is an integer
|
||||||
while True:
|
minimum_skip_length = config.minimum_skip_length
|
||||||
try:
|
|
||||||
minimum_skip_length = int(
|
choice = get_yn_input(MINIMUM_SKIP_PROMPT)
|
||||||
input("Enter minimum length of segment to skip in seconds: ")
|
if choice == "y":
|
||||||
)
|
while True:
|
||||||
break
|
try:
|
||||||
except ValueError:
|
minimum_skip_length = int(
|
||||||
print("You entered a non integer value, try again.")
|
input(MINIMUM_SKIP_SPECIFICATION_PROMPT)
|
||||||
continue
|
)
|
||||||
|
break
|
||||||
|
except ValueError:
|
||||||
|
print("You entered a non integer value, try again.")
|
||||||
|
continue
|
||||||
|
|
||||||
config.minimum_skip_length = minimum_skip_length
|
config.minimum_skip_length = minimum_skip_length
|
||||||
|
|
||||||
# Ask for minimum skip length. Confirm input is an integer
|
# Ask for minimum skip length. Confirm input is an integer
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Config:
|
|||||||
self.skip_count_tracking = True
|
self.skip_count_tracking = True
|
||||||
self.mute_ads = False
|
self.mute_ads = False
|
||||||
self.skip_ads = False
|
self.skip_ads = False
|
||||||
self.minimum_skip_length = 1
|
self.minimum_skip_length = 0
|
||||||
self.auto_play = True
|
self.auto_play = True
|
||||||
self.join_name = "iSponsorBlockTV"
|
self.join_name = "iSponsorBlockTV"
|
||||||
self.__load()
|
self.__load()
|
||||||
|
|||||||
Reference in New Issue
Block a user