@@ -93,13 +93,13 @@ function Thumbnailer:update_state()
9393
9494 self .state .ready = true
9595
96- local file_path = mp .get_property_native (" path" )
96+ local file_path = mp .get_property_native (" path" , " " )
9797 self .state .is_remote = file_path :find (" ://" ) ~= nil
9898
9999 self .state .available = false
100100
101101 -- 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" , {} )
103103 local has_video = false
104104 for i , track in pairs (track_list ) do
105105 if track .type == " video" and not track .external and not track .albumart then
@@ -118,10 +118,10 @@ end
118118
119119
120120function Thumbnailer :get_thumbnail_template ()
121- local file_path = mp .get_property_native (" path" )
121+ local file_path = mp .get_property_native (" path" , " " )
122122 local is_remote = file_path :find (" ://" ) ~= nil
123123
124- local filename = mp .get_property_native (" filename/no-ext" )
124+ local filename = mp .get_property_native (" filename/no-ext" , " " )
125125 local filesize = mp .get_property_native (" file-size" , 0 )
126126
127127 if is_remote then
143143
144144
145145function 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" , {} )
147147 local video_width = video_dec_params .dw
148148 local video_height = video_dec_params .dh
149149 if not (video_width and video_height ) then
163163
164164
165165function Thumbnailer :get_delta ()
166- local file_path = mp .get_property_native (" path" )
166+ local file_path = mp .get_property_native (" path" , " " )
167167 local file_duration = mp .get_property_native (" duration" )
168168 local is_seekable = mp .get_property_native (" seekable" )
169169
@@ -201,8 +201,8 @@ function Thumbnailer:get_thumbnail_count(delta)
201201 if delta == nil then
202202 return 0
203203 end
204- local file_duration = mp .get_property_native (" duration" )
205204
205+ local file_duration = mp .get_property_native (" duration" , 0 )
206206 return math.ceil (file_duration / delta )
207207end
208208
@@ -320,13 +320,13 @@ function Thumbnailer:_create_thumbnail_job_order()
320320end
321321
322322function Thumbnailer :prepare_source_path ()
323- local file_path = mp .get_property_native (" path" )
323+ local file_path = mp .get_property_native (" path" , " " )
324324
325325 if self .state .is_remote and thumbnailer_options .remote_direct_stream then
326326 -- Use the direct stream (possibly) provided by ytdl
327327 -- This skips ytdl on the sub-calls, making the thumbnailing faster
328328 -- 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" , " " )
330330
331331 -- edl:// urls can get LONG. In which case, save the path (URL)
332332 -- to a temporary file and use that instead.
@@ -336,7 +336,7 @@ function Thumbnailer:prepare_source_path()
336336 -- Path is too long for a playlist - just pass the original URL to
337337 -- workers and allow ytdl
338338 self .state .worker_extra .enable_ytdl = true
339- file_path = mp .get_property_native (" path" )
339+ file_path = mp .get_property_native (" path" , " " )
340340 msg .warn (" Falling back to original URL and ytdl due to LONG source path. This will be slow." )
341341
342342 elseif # file_path > 1024 then
0 commit comments