2021-01-07 14:23:59 +00:00
|
|
|
#!/usr/bin/fish
|
|
|
|
set HIFI ~/Music/HiFi
|
2021-12-04 20:53:41 +00:00
|
|
|
set LOFI /tmp/foo
|
2021-01-10 03:46:08 +00:00
|
|
|
test -f /usr/share/man/man3/Parallel::ForkManager.3 || sudo eopkg it perl-parallel-forkmanager
|
2021-01-07 14:23:59 +00:00
|
|
|
|
2021-12-04 20:53:41 +00:00
|
|
|
if test $argv
|
|
|
|
set LOFI $argv
|
|
|
|
else
|
|
|
|
mkdir $LOFI
|
|
|
|
fusermount -u $LOFI
|
|
|
|
ifuse --documents com.foobar2000.mobile $LOFI
|
|
|
|
end
|
2021-03-27 22:37:14 +00:00
|
|
|
|
2021-01-07 14:23:59 +00:00
|
|
|
if not test -d $LOFI
|
|
|
|
cd $HIFI
|
|
|
|
fd -t d -x mkdir -p $LOFI/{}
|
2021-12-04 20:53:41 +00:00
|
|
|
fd -e flac -x opusenc --bitrate 256 {} $LOFI/{.}.opus
|
2021-01-07 14:23:59 +00:00
|
|
|
end
|
|
|
|
|
2022-03-04 17:37:45 +00:00
|
|
|
set args -s $HIFI -d $LOFI -o opus -q 256 --clean sync -F 16 -c mp3,m4a,opus
|
2021-03-27 22:37:14 +00:00
|
|
|
acxi $args || wget https://github.com/smxi/acxi/raw/stable/acxi -O- -o/dev/null | perl -- - $args
|
|
|
|
|
2021-12-04 20:53:41 +00:00
|
|
|
fusermount -u $LOFI
|
|
|
|
rmdir $LOFI
|