Merge branch 'master' of https://github.com/jimmywarting/webtorrent-desktop into jimmywarting
This commit is contained in:
5
package-lock.json
generated
5
package-lock.json
generated
@@ -10601,11 +10601,6 @@
|
||||
"fd-slicer": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"zero-fill": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/zero-fill/-/zero-fill-2.2.3.tgz",
|
||||
"integrity": "sha1-o97wa6XjmuZEhQu0yirUEStIVek="
|
||||
},
|
||||
"zip-stream": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz",
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
"srt-to-vtt": "^1.1.3",
|
||||
"vlc-command": "^1.2.0",
|
||||
"webtorrent": ">=0.107.7",
|
||||
"winreg": "^1.2.4",
|
||||
"zero-fill": "^2.2.3"
|
||||
"winreg": "^1.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.3",
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
const React = require('react')
|
||||
const Bitfield = require('bitfield')
|
||||
const prettyBytes = require('prettier-bytes')
|
||||
const zeroFill = require('zero-fill')
|
||||
|
||||
const TorrentSummary = require('../lib/torrent-summary')
|
||||
const Playlist = require('../lib/playlist')
|
||||
@@ -758,14 +757,14 @@ function formatTime (time, total) {
|
||||
return '0:00'
|
||||
}
|
||||
|
||||
const totalHours = Math.floor(total / 3600)
|
||||
const totalMinutes = Math.floor(total / 60)
|
||||
const hours = Math.floor(time / 3600)
|
||||
let minutes = Math.floor(time % 3600 / 60)
|
||||
if (totalMinutes > 9) {
|
||||
minutes = zeroFill(2, minutes)
|
||||
const totalHours = total / 3600 | 0
|
||||
const totalMinutes = total / 60 | 0
|
||||
const hours = time / 3600 | 0
|
||||
let minutes = time % 3600 / 60 | 0
|
||||
if (totalMinutes > 9 && minutes < 10) {
|
||||
minutes = '0' + minutes
|
||||
}
|
||||
const seconds = zeroFill(2, Math.floor(time % 60))
|
||||
const seconds = `0${time % 60 | 0}`.slice(-2)
|
||||
|
||||
return (totalHours > 0 ? hours + ':' : '') + minutes + ':' + seconds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user