Skip to content

Commit

Permalink
fix(API > Edit Album): Replace broken video images with JPG file types
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed Dec 24, 2021
1 parent 251a8f7 commit 69aead1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/server/plugins/editAlbum/public/edit_admin_xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,13 @@ const album = {
$.each(album.json.album.item, (i, item) => {
const filename = getFilename(item.filename);
const year = filename.substr(0, filename.indexOf('-'));
const isJpg = filename.includes('jpg') || filename.includes('jpeg')
const filenamePhoto = isJpg ? filename : filename.replace('mp4', 'jpg')

$('<div>')
.click(album.photo.Invoke)
.data('photo', item)
.html(['<img src="../galleries/', galleryName, '/media/thumbs/', year, '/', filename, '"/>'].join(''))
.html(['<img src="../galleries/', galleryName, '/media/thumbs/', year, '/', filenamePhoto, '"/>'].join(''))
.appendTo('#listPhotos');
});
},
Expand Down

0 comments on commit 69aead1

Please sign in to comment.