Skip to content

Commit 732c992

Browse files
authored
SmartSkip.lua
fix autoskip graceful option, had to reposition because of changes in 1.18
1 parent d0f0f0b commit 732c992

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/SmartSkip.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- License: BSD 2-Clause License
33
-- Creator: Eisa AlAwadhi
44
-- Project: SmartSkip
5-
-- Version: 1.18
5+
-- Version: 1.19
66
-- Date: 21-09-2023
77

88
-- Related forked projects:
@@ -25,7 +25,7 @@ local o = {
2525
--SmartSkip user config--
2626
last_chapter_skip_behavior=[[ [ ["no-chapters", "silence-skip"], ["internal-chapters", "playlist-next"], ["external-chapters", "silence-skip"] ] ]],--1.09# Available options [[ [ ["no-chapters", "silence-skip"], ["internal-chapters", "playlist-next"], ["external-chapters", "chapter-next"] ] ]] -- it defaults to silence-skip so if dont define external-chapters it will be silence-skip
2727
smart_next_proceed_countdown = true, --1.18# if autoskip countdown is active, proceeds to autoskip as the next action
28-
smart_prev_cancel_countdown = false, --1.18# if autoskip countdown is active, smart_prev will cancel autoskip countdown without going backwards
28+
smart_prev_cancel_countdown = true, --1.18# if autoskip countdown is active, smart_prev will cancel autoskip countdown without going backwards
2929
--chapters user config--
3030
external_chapters_autoload = true, --0.15# rename
3131
modified_chapters_autosave=[[ ["no-chapters", "external-chapters"] ]], --1.06# add the following options --- (yes/no) or specify types ["no-chapters", "internal-chapters", "external-chapters"])
@@ -1296,7 +1296,6 @@ function chapterskip(_, current, countdown)
12961296
end)
12971297
end
12981298
end
1299-
if o.autoskip_countdown_graceful then return end
13001299
function proceed_autoskip(force) --1.18# convert it into function so we may bind it to keybind, and also use it for smartNext
13011300
if not g_autoskip_countdown_flag then kill_chapterskip_countdown() return end
13021301
if g_autoskip_countdown > 1 and not force then return end --1.18# add option to force it by passing it as true
@@ -1325,8 +1324,9 @@ function chapterskip(_, current, countdown)
13251324
skipped[skip] = true
13261325
kill_chapterskip_countdown()
13271326
end
1327+
bind_keys(o.proceed_autoskip_countdown_keybind, "proceed-autoskip-countdown", function() proceed_autoskip(true) return end) --1.19# reposition to before graceful so binding works
1328+
if o.autoskip_countdown_graceful then return end --1.19# reposition to before timeout to fix graceful
13281329
mp.add_timeout(countdown, proceed_autoskip) --1.18# bind the function instead
1329-
bind_keys(o.proceed_autoskip_countdown_keybind, "proceed-autoskip-countdown", function() proceed_autoskip(true) return end) --1.18# bind proceed with force and return
13301330
return
13311331
end
13321332
end
@@ -1362,7 +1362,6 @@ function chapterskip(_, current, countdown)
13621362
end)
13631363
end
13641364
end
1365-
if o.autoskip_countdown_graceful then return end
13661365
function proceed_autoskip(force) --1.18# convert it into function so we may bind it to keybind, and also use it for smartNext
13671366
if not g_autoskip_countdown_flag then return end
13681367
if g_autoskip_countdown > 1 and not force then return end --1.18# add option to force it by passing it as true
@@ -1391,8 +1390,9 @@ function chapterskip(_, current, countdown)
13911390
if o.autoskip_osd ~= 'no-osd' then autoskip_playlist_osd = true end
13921391
kill_chapterskip_countdown()
13931392
end
1393+
bind_keys(o.proceed_autoskip_countdown_keybind, "proceed-autoskip-countdown", function() proceed_autoskip(true) return end) --1.19# reposition to before graceful so binding works
1394+
if o.autoskip_countdown_graceful then return end --1.19# reposition to before timeout to fix graceful
13941395
mp.add_timeout(countdown, proceed_autoskip) --1.18# bind the function instead
1395-
bind_keys(o.proceed_autoskip_countdown_keybind, "proceed-autoskip-countdown", function() proceed_autoskip(true) return end) --1.18# bind proceed with force and return
13961396
end
13971397
end
13981398

0 commit comments

Comments
 (0)