mirror of
https://git.stupid.fish/teidesu/scripts.git
synced 2025-07-28 02:32:11 +10:00
chore: update public repo
This commit is contained in:
parent
96426d01c1
commit
68a2d17239
5 changed files with 50 additions and 7 deletions
18
scripts/infra/navidrome/stats.ts
Normal file
18
scripts/infra/navidrome/stats.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
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))
|
Loading…
Add table
Add a link
Reference in a new issue