mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Improve audio length display
This commit is contained in:
@@ -112,11 +112,10 @@ export class ChartSidebarComponent implements OnInit {
|
|||||||
|
|
||||||
songLength: string
|
songLength: string
|
||||||
/**
|
/**
|
||||||
* Converts <this.selectedVersion.song_length> into a readable duration.
|
* Converts `this.selectedVersion.chartMetadata.length` into a readable duration.
|
||||||
*/
|
*/
|
||||||
updateSongLength() {
|
updateSongLength() {
|
||||||
if (this.selectedVersion.song_length == 0) { this.songLength = 'Unknown' }
|
let seconds = this.selectedVersion.chartMetadata.length
|
||||||
let seconds = Math.round(this.selectedVersion.song_length / 1000)
|
|
||||||
if (seconds < 60) { this.songLength = `${seconds} second${seconds == 1 ? '' : 's'}` }
|
if (seconds < 60) { this.songLength = `${seconds} second${seconds == 1 ? '' : 's'}` }
|
||||||
let minutes = Math.floor(seconds / 60)
|
let minutes = Math.floor(seconds / 60)
|
||||||
let hours = 0
|
let hours = 0
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ export interface ChartMetadata {
|
|||||||
[difficulty: string]: number
|
[difficulty: string]: number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** number of seconds */
|
||||||
length: number
|
length: number
|
||||||
|
/** number of seconds */
|
||||||
effectiveLength: number
|
effectiveLength: number
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user