mirror of
https://github.com/koel/koel
synced 2024-12-26 12:33:06 +00:00
12 lines
335 B
TypeScript
12 lines
335 B
TypeScript
import { computed } from 'vue'
|
|
import { secondsToHis } from '@/utils'
|
|
|
|
export const useAlbumAttributes = (album: Album) => {
|
|
const length = computed(() => album.songs.reduce((acc: number, song: Song) => acc + song.length, 0))
|
|
const fmtLength = computed(() => secondsToHis(length.value))
|
|
|
|
return {
|
|
length,
|
|
fmtLength
|
|
}
|
|
}
|