mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed thumbnail file name
refs https://github.com/TryGhost/Toolbox/issues/95 - The uploaded media thumbnail name should have a "_thumb" postfix to be able to distinguish thumbnails from other files. This can be handy if we decide to store them in a different location in the future.
This commit is contained in:
parent
a1ebdc8330
commit
142eff22ee
2 changed files with 2 additions and 2 deletions
|
@ -199,7 +199,7 @@ const mediaValidation = function ({type}) {
|
|||
|
||||
req.thumbnail = thumbnailFile;
|
||||
req.thumbnail.ext = path.extname(thumbnailFile.originalname).toLowerCase();
|
||||
req.thumbnail.name = path.basename(req.file.name, path.extname(req.file.name)) + req.thumbnail.ext;
|
||||
req.thumbnail.name = `${path.basename(req.file.name, path.extname(req.file.name))}_thumb${req.thumbnail.ext}`;
|
||||
req.thumbnail.type = req.thumbnail.mimetype;
|
||||
|
||||
if (!checkFileIsValid(req.file, contentTypes, extensions)) {
|
||||
|
|
|
@ -34,7 +34,7 @@ describe('Media API', function () {
|
|||
.expect(201);
|
||||
|
||||
res.body.media[0].url.should.match(new RegExp(`${config.get('url')}/content/media/\\d+/\\d+/sample_640x360.mp4`));
|
||||
res.body.media[0].thumbnail_url.should.match(new RegExp(`${config.get('url')}/content/media/\\d+/\\d+/sample_640x360.png`));
|
||||
res.body.media[0].thumbnail_url.should.match(new RegExp(`${config.get('url')}/content/media/\\d+/\\d+/sample_640x360_thumb.png`));
|
||||
res.body.media[0].ref.should.equal('https://ghost.org/sample_640x360.mp4');
|
||||
|
||||
media.push(res.body.media[0].url.replace(config.get('url'), ''));
|
||||
|
|
Loading…
Reference in a new issue