forked from GithubBackups/vichan
Fix: external post preview due to thumbnail extension change
Hotfix for post-hover.js external post preview so that it works with the recent change to newly generated thumbnails.
This commit is contained in:
parent
8ddc472239
commit
c1ac4791a7
@ -211,9 +211,21 @@ onready(function(){
|
||||
var file_ext = this.ext;
|
||||
|
||||
if (this.isImage && !this.isSpoiler) {
|
||||
// video files uses jpg for thumbnail
|
||||
if (this.ext === '.webm' || this.ext === '.mp4' || this.ext === '.jpeg') this.ext = '.jpg';
|
||||
|
||||
// at some point around 28/29th of Jan, 2015; all the newly generated thumbnails switched to using jpg
|
||||
// this is a quick hack to ensure that external preview (mostly) works with old and new posts
|
||||
|
||||
// Note: please update if a more accurate timestamp is known
|
||||
if (data.last_modified > 1422489600) {
|
||||
this.ext = '.jpg';
|
||||
} else {
|
||||
if (this.ext === '.webm' || this.ext === '.mp4' || this.ext === '.jpeg') {
|
||||
this.ext = '.jpg';
|
||||
}
|
||||
}
|
||||
|
||||
thumb_url = '/'+ board +'/thumb/' + this.tim + this.ext;
|
||||
|
||||
} else {
|
||||
thumb_url = (this.isSpoiler) ? '/static/spoiler.png' : '/static/file.png';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user