mirror of
https://git.stupid.fish/teidesu/scripts.git
synced 2025-07-28 02:32:11 +10:00
18 lines
535 B
TypeScript
18 lines
535 B
TypeScript
import { fetchSongs, fetchSongsIter } from '../../utils/navidrome.ts'
|
|
|
|
let count = 0
|
|
let totalSize = 0
|
|
let totalDuration = 0
|
|
|
|
console.log('⌛ fetching songs...')
|
|
|
|
for await (const song of fetchSongsIter()) {
|
|
count += 1
|
|
totalSize += song.size
|
|
totalDuration += song.duration
|
|
}
|
|
|
|
console.log('---')
|
|
console.log('total songs: %d', count)
|
|
console.log('total size: %d GiB', (totalSize / 1024 / 1024 / 1024).toFixed(3))
|
|
console.log('total duration: %d min (%d h)', (totalDuration / 60).toFixed(3), (totalDuration / 60 / 60).toFixed(3))
|