Add #10 - Single item as a gallery

This commit is contained in:
Alan Grainger
2024-11-04 20:23:34 +01:00
parent 0afc820f7b
commit 71feba9ce8
10 changed files with 87 additions and 54 deletions
+4 -7
View File
@@ -1,16 +1,13 @@
import immich from './immich'
import { Response } from 'express-serve-static-core'
import { Asset, AssetType, ImageSize, SharedLink } from './types'
import { getConfigOption } from './functions'
class Render {
lgConfig = {}
lgConfig
constructor () {
try {
// Import user-provided lightGallery config (if exists)
const config = require('../config.json')
if (typeof config === 'object' && config.lightGallery) this.lgConfig = config.lightGallery
} catch (e) { }
this.lgConfig = getConfigOption('lightGallery', {})
}
async assetBuffer (res: Response, asset: Asset, size?: ImageSize) {
@@ -61,7 +58,7 @@ class Render {
items,
openItem,
title: this.title(share),
lgConfig: this.lgConfig
lgConfig: getConfigOption('lightGallery', {})
})
}