docs: add comments to main recipes
This commit is contained in:
parent
e5fee6517d
commit
e11b838dcc
1 changed files with 11 additions and 11 deletions
22
justfile
22
justfile
|
@ -6,7 +6,7 @@ recent: select-download-recent convert refile
|
||||||
full: select-download-full convert refile
|
full: select-download-full convert refile
|
||||||
@tree M4B/
|
@tree M4B/
|
||||||
|
|
||||||
doctor:
|
doctor: # Check all required executables are found
|
||||||
@echo "Verify required executables are on the path:"
|
@echo "Verify required executables are on the path:"
|
||||||
just _doc_require_exec_all audible just fzf jq ffmpeg refile-m4b
|
just _doc_require_exec_all audible just fzf jq ffmpeg refile-m4b
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ _doc_require_exec exec:
|
||||||
echo "- OKAY : {{ exec }} => ${EXEC}"
|
echo "- OKAY : {{ exec }} => ${EXEC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
select-download-recent:
|
select-download-recent: # Select titles from those added in the latest library, and download them
|
||||||
just select-download library-recent.txt
|
just select-download library-recent.txt
|
||||||
|
|
||||||
select-download-full:
|
select-download-full: # Select titles from the full latest library, and download them
|
||||||
just select-download $(just latest-library)
|
just select-download $(just latest-library)
|
||||||
|
|
||||||
select-download library:
|
select-download library: # Select titles from the {{ library }}, and download them
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
SELECTION=$(cat {{library}} | sort -k 2 | fzf -e -m)
|
SELECTION=$(cat {{library}} | sort -k 2 | fzf -e -m)
|
||||||
ASINS=""
|
ASINS=""
|
||||||
|
@ -40,7 +40,7 @@ select-download library:
|
||||||
done <<< $SELECTION
|
done <<< $SELECTION
|
||||||
just _download-asin $ASINS
|
just _download-asin $ASINS
|
||||||
|
|
||||||
fetch-library:
|
fetch-library: # Download the latest version of the Library
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
PREVIOUS=$(just latest-library)
|
PREVIOUS=$(just latest-library)
|
||||||
|
@ -64,14 +64,14 @@ _download-asin *asins:
|
||||||
cd TEMP && audible download --aax-fallback {{ asins }}
|
cd TEMP && audible download --aax-fallback {{ asins }}
|
||||||
just post-download
|
just post-download
|
||||||
|
|
||||||
post-download:
|
post-download: # Move successfully downloaded aax, aaxc and voucher sinto AAX or AAXC
|
||||||
just _require_dir AAX AAXC
|
just _require_dir AAX AAXC
|
||||||
just _move AAX/ TEMP/*.aax
|
just _move AAX/ TEMP/*.aax
|
||||||
just _move AAXC/ TEMP/*.aaxc TEMP/*.voucher
|
just _move AAXC/ TEMP/*.aaxc TEMP/*.voucher
|
||||||
|
|
||||||
convert: convert-aax convert-aaxc
|
convert: convert-aax convert-aaxc
|
||||||
|
|
||||||
convert-aax:
|
convert-aax: # Convert all the AAX files to M4B
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
just _require_dir M4B
|
just _require_dir M4B
|
||||||
if [ $(fd . AAX | wc -l) -gt 0 ]
|
if [ $(fd . AAX | wc -l) -gt 0 ]
|
||||||
|
@ -91,7 +91,7 @@ convert-aax:
|
||||||
echo No AAX to convert
|
echo No AAX to convert
|
||||||
fi
|
fi
|
||||||
|
|
||||||
convert-aaxc:
|
convert-aaxc: # Convert all the AAXC files to M4B
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
just _require_dir M4B
|
just _require_dir M4B
|
||||||
if [ $(fd . AAXC | wc -l) -gt 0 ]
|
if [ $(fd . AAXC | wc -l) -gt 0 ]
|
||||||
|
@ -120,10 +120,10 @@ _convert-one-aaxc aaxc_file voucher_file m4b_file:
|
||||||
{{ m4b_file }} && \
|
{{ m4b_file }} && \
|
||||||
rm {{ aaxc_file }} {{ voucher_file }}
|
rm {{ aaxc_file }} {{ voucher_file }}
|
||||||
|
|
||||||
refile:
|
refile: # Rename and move files in M4B based on their metadata
|
||||||
refile-m4b M4B
|
refile-m4b M4B
|
||||||
|
|
||||||
archive:
|
archive: # Move the contents of M4B to the archive
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
if [ -d M4B ] && [ -n "${AUDIOBOOK_ARCHIVE}" ] && [ -d "${AUDIOBOOK_ARCHIVE}" ];
|
if [ -d M4B ] && [ -n "${AUDIOBOOK_ARCHIVE}" ] && [ -d "${AUDIOBOOK_ARCHIVE}" ];
|
||||||
then
|
then
|
||||||
|
@ -139,7 +139,7 @@ archive:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean:
|
clean: # Delete the directories TEMP, AAX, AAXC and M4B, including all files within
|
||||||
for target in TEMP AAX AAXC M4B ; do just _clean $target ; done
|
for target in TEMP AAX AAXC M4B ; do just _clean $target ; done
|
||||||
|
|
||||||
_clean target:
|
_clean target:
|
||||||
|
|
Loading…
Reference in a new issue