museria 0.2.47 → 0.2.49

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "museria",
3
- "version": "0.2.47",
3
+ "version": "0.2.49",
4
4
  "description": "Decentralized music storage",
5
5
  "main": "./src/index.js",
6
6
  "bin": {
@@ -57,7 +57,7 @@
57
57
  "html-loader": "^2.1.2",
58
58
  "husky": "^4.3.6",
59
59
  "mini-css-extract-plugin": "^1.3.9",
60
- "mocha": "^9.1.3",
60
+ "mocha": "^10.2.0",
61
61
  "node-polyfill-webpack-plugin": "^1.0.3",
62
62
  "resolve-url-loader": "^5.0.0",
63
63
  "sass": "^1.43.4",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@fortawesome/fontawesome-free": "^5.15.0",
72
- "akili": "^1.2.19",
72
+ "akili": "^1.2.22",
73
73
  "base64url": "^3.0.1",
74
74
  "bootstrap": "^4.5.3",
75
75
  "chalk": "^4.1.2",
@@ -77,16 +77,16 @@
77
77
  "express": "^4.17.1",
78
78
  "fs-extra": "^9.0.1",
79
79
  "lodash": "^4.17.20",
80
- "metastocle": "^0.2.31",
81
- "music-metadata": "^6.4.0",
80
+ "metastocle": "^0.2.32",
81
+ "music-metadata": "^7.13.0",
82
82
  "node-fetch": "^2.6.1",
83
83
  "node-id3": "^0.2.2",
84
84
  "sanitize-filename": "^1.6.3",
85
85
  "serve-favicon": "^2.5.0",
86
86
  "sharp": "^0.30.0",
87
87
  "splaytree": "^3.1.0",
88
- "spreadable": "^0.2.27",
89
- "storacle": "^0.2.27",
88
+ "spreadable": "^0.2.28",
89
+ "storacle": "^0.2.28",
90
90
  "transliteration": "^2.2.0"
91
91
  },
92
92
  "repository": {
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: 85,
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
  }