mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
gallery video support
This commit is contained in:
@@ -100,8 +100,8 @@ async function delayFetchThumb(fn) {
|
||||
}
|
||||
const json = await res.json();
|
||||
outstanding--;
|
||||
if (!res || !json || json.error) {
|
||||
console.error(json.error);
|
||||
if (!res || !json || json.error || Object.keys(json).length === 0) {
|
||||
if (json.error) console.error(json.error);
|
||||
return undefined;
|
||||
}
|
||||
return json;
|
||||
@@ -125,7 +125,7 @@ class GalleryFile extends HTMLElement {
|
||||
async connectedCallback() {
|
||||
if (this.shadow.children.length > 0) return;
|
||||
const ext = this.name.split('.').pop().toLowerCase();
|
||||
if (!['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'].includes(ext)) return;
|
||||
if (!['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'mp4'].includes(ext)) return;
|
||||
this.hash = await getHash(`${this.folder}/${this.name}/${this.size}/${this.mtime}`); // eslint-disable-line no-use-before-define
|
||||
const style = document.createElement('style');
|
||||
const width = opts.browser_fixed_width ? `${opts.extra_networks_card_size}px` : 'unset';
|
||||
@@ -158,7 +158,7 @@ class GalleryFile extends HTMLElement {
|
||||
}
|
||||
};
|
||||
let ok = true;
|
||||
if (cache) {
|
||||
if (cache && cache.img) {
|
||||
img.src = cache.img;
|
||||
this.exif = cache.exif;
|
||||
this.width = cache.width;
|
||||
|
||||
Reference in New Issue
Block a user