mirror of
https://github.com/koel/koel
synced 2024-12-25 12:03: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
|
|
}
|
|
}
|