feat: --decorate-as

This commit is contained in:
2025-09-12 15:39:20 +02:00
parent 6dc107c7c4
commit 8112586f87
4 changed files with 114 additions and 1 deletions

View File

@@ -360,6 +360,21 @@ case "${1:-}" in
fi
exit 0
;;
"--decorate-as")
# Decorate the specified directory as given MusicBrainz release
#
# @argument $2: path
# @argument $3: MusicBrainz release ID
[ ! "${2:-}" ] && err "You did not specify a directory." && exit 1
[ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1
[ ! "${3:-}" ] && err "You did not specify a MusicBrainz release ID." && exit 1
[ ! "$(mb_release "$3" | $JQ '.title // ""')" ] && err "Did you specify a correct MusicBrainz release ID?" && exit 1
if ! decorate_as "$2" "$3"; then
err "Something went wrong."
exit 1
fi
exit 0
;;
"--reload-database")
# Reload database of local music
#
@@ -392,6 +407,7 @@ GENERAL OPTIONS:
MANAGE LOCAL MUSIC:
--decorate <path> Decorate directory containing a tagged release
--decorate-as <path> <mbid> Decorate directory as the relase <mbid>
--reload-database <path> Populate database with decorated local music from <path>
EOF
exit 0