Compare commits

..

No commits in common. "5910987781f97caa1197264584b9c27580f5d251" and "e5484f0a6d988dab9772665ef2bc9cb7f7aef5c9" have entirely different histories.

2 changed files with 0 additions and 38 deletions

View file

@ -20,12 +20,6 @@ Python dependencies:
```pip install -r requirements.txt```
Optional: brotli
### About cache folder
funkwhale-cli first to cache tracks before playing. Cache is persistent and You manage manually as is.
Cache structure: cache/domain.tld/[track uuid]
You can to play tracks offline, example: mpv --shuffle cache/*/*
cache_helper.sh - just useful for compression cache (lossy: vorbis 128 kbps, no thumbnail)
Also, tnx Inex for his FunkWhale instance (set by default instance)
[1]**Warning:** may content _unofficial instances_

View file

@ -1,32 +0,0 @@
#!/bin/bash
if [ ! -n "$1" ]; then
echo 'Usage: cache_helper.sh path/to/cache'
exit 1
fi
total_before=0
total_after=0
for i in "$1"/*/*; do
if [ $(ffprobe -hide_banner -print_format json -select_streams a:0 -show_streams "$i" | jq -r '.streams[0].bit_rate') -gt 128000 ]; then
size_before=$(stat --format=%s "$i")
total_before=$(( $total_before + $size_before ))
ffmpeg -hide_banner -loglevel error -i "$i" -vn "$i".ogg
if [ $? -eq 0 ]; then
size_after=$(stat --format=%s "$i".ogg)
total_after=$(( $total_after + $size_after ))
size_reduced=$(( $size_before - $size_after ))
echo "Reduced: $(echo $size_reduced | numfmt --to=iec)"
mv "$i".ogg "$i"
else
echo "$i convert failed"
fi
else
echo "$i already OK"
fi
done
echo "Total before: $(echo $total_before | numfmt --to=iec)"
echo "Total after: $(echo $total_after | numfmt --to=iec)"
echo "Note: only included processed tracks"