mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-04-19 21:03:56 +02:00
Remove redundent code
This commit is contained in:
parent
9c91ce1a13
commit
95ea8e9ad3
1 changed files with 2 additions and 8 deletions
|
@ -5,6 +5,7 @@ import PlayerManager from '../managers/player';
|
||||||
import LoadingMessage from '../utils/loading-message';
|
import LoadingMessage from '../utils/loading-message';
|
||||||
import errorMsg from '../utils/error-msg';
|
import errorMsg from '../utils/error-msg';
|
||||||
import Command from '.';
|
import Command from '.';
|
||||||
|
import {parseTime} from '../utils/time';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export default class implements Command {
|
export default class implements Command {
|
||||||
|
@ -44,14 +45,7 @@ export default class implements Command {
|
||||||
let seekTime = 0;
|
let seekTime = 0;
|
||||||
|
|
||||||
if (time.includes(':')) {
|
if (time.includes(':')) {
|
||||||
const timeGroups = time.split(':').map(t => parseInt(t, 10));
|
seekTime = parseTime(time);
|
||||||
let currentTimePeriod = 1;
|
|
||||||
|
|
||||||
for (let i = timeGroups.length - 1; i >= 0; i--) {
|
|
||||||
seekTime += currentTimePeriod * timeGroups[i];
|
|
||||||
|
|
||||||
currentTimePeriod *= 60;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
seekTime = parseInt(time, 10);
|
seekTime = parseInt(time, 10);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue