SHA256
1
0

Initial commit

This commit is contained in:
2025-12-04 23:23:42 -05:00
commit 765f598313
58 changed files with 2736 additions and 0 deletions

21
scripts/estimate-musicdir Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Estimate the size of a music directory if FLACs are lossy compressed
MUSIC_DIR="${1:-/home/bryan/media/music}"
# Sum existing MP3s
MP3_BYTES=$(find "$MUSIC_DIR" -type f -iname "*.mp3" -exec du -b {} + | awk '{sum+=$1} END{print sum}')
# Sum FLACs
FLAC_BYTES=$(find "$MUSIC_DIR" -type f -iname "*.flac" -exec du -b {} + | awk '{sum+=$1} END{print sum}')
# Estimate FLACs as 160k Ogg (roughly 1/8 size of FLAC)
EST_FLAC_OGG=$(( FLAC_BYTES / 8 ))
# Total estimated size
TOTAL_EST=$(( MP3_BYTES + EST_FLAC_OGG ))
# Human-readable
EST_HR=$(numfmt --to=iec-i --suffix=B "$TOTAL_EST")
echo "Estimated total size (MP3 + FLAC → 160k Ogg): $EST_HR"