museria 0.2.48 → 0.2.49
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/client/museria.client.js +6 -6
- package/dist/face/museria.face.js +7 -7
- package/dist/face/style.css +1 -1
- package/package.json +1 -1
- package/src/node.js +7 -4
package/dist/face/style.css
CHANGED
package/package.json
CHANGED
package/src/node.js
CHANGED
@@ -57,12 +57,12 @@ module.exports = (Parent) => {
|
|
57
57
|
relevanceTime: '14d',
|
58
58
|
prepareTitle: true,
|
59
59
|
prepareCover: true,
|
60
|
-
coverQuality:
|
60
|
+
coverQuality: 80,
|
61
61
|
coverMinSize: 200,
|
62
62
|
coverMaxSize: 500,
|
63
63
|
coverMaxFileSize: '110kb'
|
64
64
|
},
|
65
|
-
storage: {
|
65
|
+
storage: {
|
66
66
|
autoCleanSize: '30mb',
|
67
67
|
tempLifetime: '10m',
|
68
68
|
dataSize: '95% - 2gb',
|
@@ -387,8 +387,7 @@ module.exports = (Parent) => {
|
|
387
387
|
width = Math.floor(width / dev);
|
388
388
|
height = Math.floor(height / dev);
|
389
389
|
const size = width > height? height: width;
|
390
|
-
|
391
|
-
const buff = await image
|
390
|
+
let buff = await image
|
392
391
|
.jpeg({ quality: this.options.music.coverQuality })
|
393
392
|
.resize(width, height)
|
394
393
|
.extract({
|
@@ -399,6 +398,10 @@ module.exports = (Parent) => {
|
|
399
398
|
})
|
400
399
|
.toBuffer();
|
401
400
|
|
401
|
+
if(buff.byteLength > metadata.size) {
|
402
|
+
buff = buffer;
|
403
|
+
}
|
404
|
+
|
402
405
|
if(buff.byteLength > maxFileSize) {
|
403
406
|
throw new errors.WorkError(`Maximum size of a cover file is ${maxFileSize} byte(s)`, 'ERR_MUSERIA_COVER_MAX_FILE_SIZE');
|
404
407
|
}
|