docs: add comments to main recipes

This commit is contained in:
Paul Campbell 2024-12-26 08:47:04 +00:00
parent e5fee6517d
commit e11b838dcc

View file

@ -6,7 +6,7 @@ recent: select-download-recent convert refile
full: select-download-full convert refile
@tree M4B/
doctor:
doctor: # Check all required executables are found
@echo "Verify required executables are on the path:"
just _doc_require_exec_all audible just fzf jq ffmpeg refile-m4b
@ -22,13 +22,13 @@ _doc_require_exec exec:
echo "- OKAY : {{ exec }} => ${EXEC}"
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
select-download-full:
select-download-full: # Select titles from the full latest library, and download them
just select-download $(just latest-library)
select-download library:
select-download library: # Select titles from the {{ library }}, and download them
#!/usr/bin/env bash
SELECTION=$(cat {{library}} | sort -k 2 | fzf -e -m)
ASINS=""
@ -40,7 +40,7 @@ select-download library:
done <<< $SELECTION
just _download-asin $ASINS
fetch-library:
fetch-library: # Download the latest version of the Library
#!/usr/bin/env bash
set -e
PREVIOUS=$(just latest-library)
@ -64,14 +64,14 @@ _download-asin *asins:
cd TEMP && audible download --aax-fallback {{ asins }}
just post-download
post-download:
post-download: # Move successfully downloaded aax, aaxc and voucher sinto AAX or AAXC
just _require_dir AAX AAXC
just _move AAX/ TEMP/*.aax
just _move AAXC/ TEMP/*.aaxc TEMP/*.voucher
convert: convert-aax convert-aaxc
convert-aax:
convert-aax: # Convert all the AAX files to M4B
#!/usr/bin/env bash
just _require_dir M4B
if [ $(fd . AAX | wc -l) -gt 0 ]
@ -91,7 +91,7 @@ convert-aax:
echo No AAX to convert
fi
convert-aaxc:
convert-aaxc: # Convert all the AAXC files to M4B
#!/usr/bin/env bash
just _require_dir M4B
if [ $(fd . AAXC | wc -l) -gt 0 ]
@ -120,10 +120,10 @@ _convert-one-aaxc aaxc_file voucher_file m4b_file:
{{ m4b_file }} && \
rm {{ aaxc_file }} {{ voucher_file }}
refile:
refile: # Rename and move files in M4B based on their metadata
refile-m4b M4B
archive:
archive: # Move the contents of M4B to the archive
#!/usr/bin/env bash
if [ -d M4B ] && [ -n "${AUDIOBOOK_ARCHIVE}" ] && [ -d "${AUDIOBOOK_ARCHIVE}" ];
then
@ -139,7 +139,7 @@ archive:
exit 1
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
_clean target: