Multifile support in ImageCommon.decodeError. #2171
This commit is contained in:
parent
2fadf026b3
commit
b588ca43fd
@ -25,11 +25,11 @@ ImageCommon =
|
|||||||
cacheError: ->
|
cacheError: ->
|
||||||
delete ImageCommon.cache if ImageCommon.cache is @
|
delete ImageCommon.cache if ImageCommon.cache is @
|
||||||
|
|
||||||
decodeError: (file, post) ->
|
decodeError: (file, fileObj) ->
|
||||||
return false unless file.error?.code is MediaError.MEDIA_ERR_DECODE
|
return false unless file.error?.code is MediaError.MEDIA_ERR_DECODE
|
||||||
if not (message = $ '.warning', post.file.thumb.parentNode)
|
if not (message = $ '.warning', fileObj.thumb.parentNode)
|
||||||
message = $.el 'div', className: 'warning'
|
message = $.el 'div', className: 'warning'
|
||||||
$.after post.file.thumb, message
|
$.after fileObj.thumb, message
|
||||||
message.textContent = 'Error: Corrupt or unplayable video'
|
message.textContent = 'Error: Corrupt or unplayable video'
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|||||||
@ -267,7 +267,7 @@ ImageExpand =
|
|||||||
# - after the image started loading.
|
# - after the image started loading.
|
||||||
# Don't try to re-expand if it was already contracted.
|
# Don't try to re-expand if it was already contracted.
|
||||||
return unless post.file.isExpanding or post.file.isExpanded
|
return unless post.file.isExpanding or post.file.isExpanded
|
||||||
if ImageCommon.decodeError @, post
|
if ImageCommon.decodeError @, post.file
|
||||||
return ImageExpand.contract post
|
return ImageExpand.contract post
|
||||||
# Don't autoretry images from the archive.
|
# Don't autoretry images from the archive.
|
||||||
if ImageCommon.isFromArchive @
|
if ImageCommon.isFromArchive @
|
||||||
|
|||||||
@ -23,7 +23,7 @@ ImageHover =
|
|||||||
return unless doc.contains @
|
return unless doc.contains @
|
||||||
{isVideo} = file
|
{isVideo} = file
|
||||||
return if file.isExpanding or file.isExpanded or g.SITE.isThumbExpanded?(file)
|
return if file.isExpanding or file.isExpanded or g.SITE.isThumbExpanded?(file)
|
||||||
error = ImageHover.error post
|
error = ImageHover.error post, file
|
||||||
if ImageCommon.cache?.dataset.fullID is post.fullID
|
if ImageCommon.cache?.dataset.fullID is post.fullID
|
||||||
el = ImageCommon.popCache()
|
el = ImageCommon.popCache()
|
||||||
$.on el, 'error', error
|
$.on el, 'error', error
|
||||||
@ -69,8 +69,8 @@ ImageHover =
|
|||||||
$.rm el
|
$.rm el
|
||||||
el.removeAttribute 'style'
|
el.removeAttribute 'style'
|
||||||
|
|
||||||
error: (post) -> ->
|
error: (post, file) -> ->
|
||||||
return if ImageCommon.decodeError @, post
|
return if ImageCommon.decodeError @, file
|
||||||
ImageCommon.error @, post, 3 * $.SECOND, (URL) =>
|
ImageCommon.error @, post, 3 * $.SECOND, (URL) =>
|
||||||
if URL
|
if URL
|
||||||
@src = URL + if @src is URL then '?' + Date.now() else ''
|
@src = URL + if @src is URL then '?' + Date.now() else ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user