This commit is contained in:
tmshv committed 2016-11-23 02:11:21 +03:00
1 parent a4b4e07687
commit e7a4eab102
11 files changed
+99 -32

No files matched your search

+2 -1
View File
@@ -45,7 +45,8 @@ function album() {
const processAlbum = async album => {
album.url = `/album/${album.id}`;
const previewImageId = album.images.length ? album.images[0] : null;
const previewFromImage = imgs => imgs.length ? imgs[0] : null;
const previewImageId = album.preview ? album.preview : previewFromImage(album.images);
if (previewImageId) {
const image = await c('images').findOne({_id: previewImageId});
album.preview = image.data.medium;