@@ -93,13 +93,13 @@ function Thumbnailer:update_state()
93
93
94
94
self .state .ready = true
95
95
96
- local file_path = mp .get_property_native (" path" )
96
+ local file_path = mp .get_property_native (" path" , " " )
97
97
self .state .is_remote = file_path :find (" ://" ) ~= nil
98
98
99
99
self .state .available = false
100
100
101
101
-- Make sure the file has video (and not just albumart)
102
- local track_list = mp .get_property_native (" track-list" )
102
+ local track_list = mp .get_property_native (" track-list" , {} )
103
103
local has_video = false
104
104
for i , track in pairs (track_list ) do
105
105
if track .type == " video" and not track .external and not track .albumart then
@@ -118,10 +118,10 @@ end
118
118
119
119
120
120
function Thumbnailer :get_thumbnail_template ()
121
- local file_path = mp .get_property_native (" path" )
121
+ local file_path = mp .get_property_native (" path" , " " )
122
122
local is_remote = file_path :find (" ://" ) ~= nil
123
123
124
- local filename = mp .get_property_native (" filename/no-ext" )
124
+ local filename = mp .get_property_native (" filename/no-ext" , " " )
125
125
local filesize = mp .get_property_native (" file-size" , 0 )
126
126
127
127
if is_remote then
143
143
144
144
145
145
function Thumbnailer :get_thumbnail_size ()
146
- local video_dec_params = mp .get_property_native (" video-dec-params" )
146
+ local video_dec_params = mp .get_property_native (" video-dec-params" , {} )
147
147
local video_width = video_dec_params .dw
148
148
local video_height = video_dec_params .dh
149
149
if not (video_width and video_height ) then
163
163
164
164
165
165
function Thumbnailer :get_delta ()
166
- local file_path = mp .get_property_native (" path" )
166
+ local file_path = mp .get_property_native (" path" , " " )
167
167
local file_duration = mp .get_property_native (" duration" )
168
168
local is_seekable = mp .get_property_native (" seekable" )
169
169
@@ -201,8 +201,8 @@ function Thumbnailer:get_thumbnail_count(delta)
201
201
if delta == nil then
202
202
return 0
203
203
end
204
- local file_duration = mp .get_property_native (" duration" )
205
204
205
+ local file_duration = mp .get_property_native (" duration" , 0 )
206
206
return math.ceil (file_duration / delta )
207
207
end
208
208
@@ -320,13 +320,13 @@ function Thumbnailer:_create_thumbnail_job_order()
320
320
end
321
321
322
322
function Thumbnailer :prepare_source_path ()
323
- local file_path = mp .get_property_native (" path" )
323
+ local file_path = mp .get_property_native (" path" , " " )
324
324
325
325
if self .state .is_remote and thumbnailer_options .remote_direct_stream then
326
326
-- Use the direct stream (possibly) provided by ytdl
327
327
-- This skips ytdl on the sub-calls, making the thumbnailing faster
328
328
-- Works well on YouTube, rest not really tested
329
- file_path = mp .get_property_native (" stream-path" )
329
+ file_path = mp .get_property_native (" stream-path" , " " )
330
330
331
331
-- edl:// urls can get LONG. In which case, save the path (URL)
332
332
-- to a temporary file and use that instead.
@@ -336,7 +336,7 @@ function Thumbnailer:prepare_source_path()
336
336
-- Path is too long for a playlist - just pass the original URL to
337
337
-- workers and allow ytdl
338
338
self .state .worker_extra .enable_ytdl = true
339
- file_path = mp .get_property_native (" path" )
339
+ file_path = mp .get_property_native (" path" , " " )
340
340
msg .warn (" Falling back to original URL and ytdl due to LONG source path. This will be slow." )
341
341
342
342
elseif # file_path > 1024 then
0 commit comments