Update ImageCommon.error to handle alternate URL for archived thread JSON.

This commit is contained in:
ccd0 2019-12-13 12:27:29 -08:00
parent dc499dab90
commit 7760b6d5a6

View File

@ -57,8 +57,12 @@ ImageCommon =
threadJSON = g.SITE.urls.threadJSON?(post) threadJSON = g.SITE.urls.threadJSON?(post)
return unless threadJSON return unless threadJSON
$.ajax threadJSON, onloadend: -> parseJSON = (isArchiveURL) ->
post.kill !post.isClone, fileObj.index if @status is 404 if @status is 404
if !isArchiveURL and (archivedThreadJSON = g.SITE.urls.archivedThreadJSON?(post))
$.ajax archivedThreadJSON, onloadend: -> parseJSON.call(@, true)
else
post.kill !post.isClone, fileObj.index
return redirect() if @status isnt 200 return redirect() if @status isnt 200
for postObj in @response.posts for postObj in @response.posts
break if postObj.no is post.ID break if postObj.no is post.ID
@ -70,6 +74,7 @@ ImageCommon =
redirect() redirect()
else else
url = fileObj.url url = fileObj.url
$.ajax threadJSON, onloadend: -> parseJSON.call(@)
# Add controls, but not until the mouse is moved over the video. # Add controls, but not until the mouse is moved over the video.
addControls: (video) -> addControls: (video) ->