Make MP4 behavior consistent with WEBM, and don't error on files without extension.

This commit is contained in:
ccd0 2019-08-04 20:11:09 -07:00
parent 5c59ecf0ab
commit 2b52a66550

View File

@ -53,7 +53,11 @@ ImageLoader =
prefetch: (post, file) ->
{isImage, isVideo, thumb, url} = file
return if file.isPrefetched or !(isImage or isVideo) or post.isHidden or post.thread.isHidden
type = if (match = url.match(/\.([^.]+)$/)[1].toUpperCase()) is 'JPEG' then 'JPG' else match
if isVideo
type = 'WEBM'
else
type = url.match(/\.([^.]+)$/)?[1].toUpperCase()
type = 'JPG' if type is 'JPEG'
replace = Conf["Replace #{type}"] and !/spoiler/.test(thumb.src or thumb.dataset.src)
return unless replace or Conf['prefetch']
return if $.hasClass doc, 'catalog-mode'