1
Fork 0

e621: fetch more missing previews

This commit is contained in:
Conduitry 2020-04-14 07:51:09 -04:00
parent 1a50312757
commit 7a97ddf61c

View file

@ -157,4 +157,10 @@ const augment_results = (container, posts, link_params) => {
el.src = get_preview_url((await make_request(`/posts/${el.closest('[data-id]').dataset.id}.json`)).post);
}
// fetch more missing previews
for (const el of document.querySelectorAll('[data-id]:not([data-flags=deleted]):not([data-md5]) .preview')) {
const id = el.closest('[data-id]').dataset.id;
el.appendChild(dom(['a', { href: `/posts/${id}` }, ['img', { src: get_preview_url((await make_request(`/posts/${id}.json`)).post) }]]));
}
})();