Skip to content

Commit f82a221

Browse files
committed
add remote_autogenerate_max_duration
1 parent 933a396 commit f82a221

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ mpv_hr_seek=yes
142142
# Defaults to no
143143
thumbnail_network=no
144144

145+
# Same as autogenerate_max_duration but for remote videos
146+
# Defaults to 1200 (20 minutes)
147+
remote_autogenerate_max_duration=1200
145148
# Override thumbnail count, min/max delta, as above
146149
remote_thumbnail_count=60
147150
remote_min_delta=15

src/options.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ local thumbnailer_options = {
112112

113113
-- Allow thumbnailing network paths (naive check for "://")
114114
thumbnail_network = false,
115+
-- Same as autogenerate_max_duration but for remote videos
116+
remote_autogenerate_max_duration = 1200, -- 20 min
115117
-- Override thumbnail count, min/max delta
116118
remote_thumbnail_count = 60,
117119
remote_min_delta = 15,

src/thumbnailer_shared.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ function Thumbnailer:on_video_change(params)
7878
self:update_state()
7979
self:check_storyboard_async(function()
8080
local duration = mp.get_property_native("duration")
81+
local max_duration
82+
if self.state.is_remote then
83+
max_duration = thumbnailer_options.autogenerate_max_duration_remote
84+
else
85+
max_duration = thumbnailer_options.autogenerate_max_duration
86+
end
8187
local max_duration = thumbnailer_options.autogenerate_max_duration
8288

8389
if duration ~= nil and self.state.available and thumbnailer_options.autogenerate then

0 commit comments

Comments
 (0)