From a16b5b5add385524208a38e8f1992097a253129d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Wed, 8 May 2019 13:55:34 +0200 Subject: [PATCH] Removed zero-fill sets the version the same way webtorrent dose https://github.com/webtorrent/webtorrent/blob/f8923a66a8b1178a412b067bc913e267025b3d57/index.js#L27-L29 --- src/renderer/webtorrent.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/renderer/webtorrent.js b/src/renderer/webtorrent.js index 38d48b24..706d45a1 100644 --- a/src/renderer/webtorrent.js +++ b/src/renderer/webtorrent.js @@ -12,7 +12,6 @@ const mm = require('music-metadata') const networkAddress = require('network-address') const path = require('path') const WebTorrent = require('webtorrent') -const zeroFill = require('zero-fill') const crashReporter = require('../crash-reporter') const config = require('../config') @@ -41,10 +40,9 @@ const VERSION = require('../../package.json').version * '0.16.1' -> '0016' * '1.2.5' -> '0102' */ -const VERSION_STR = VERSION.match(/([0-9]+)/g) - .slice(0, 2) - .map((v) => zeroFill(2, v)) - .join('') +const VERSION_STR = VERSION + .replace(/\d*./g, v => `0${v % 100}`.slice(-2)) + .slice(0, 4) /** * Version prefix string (used in peer ID). WebTorrent uses the Azureus-style