--decorate
This commit is contained in:
41
src/main.sh
41
src/main.sh
@@ -8,6 +8,9 @@ set -eu
|
||||
# Load helper methods
|
||||
. "sh/helper.sh"
|
||||
|
||||
# Load configuration
|
||||
. "sh/config.sh"
|
||||
|
||||
# Load theme
|
||||
. "sh/theme.sh"
|
||||
|
||||
@@ -29,6 +32,22 @@ set -eu
|
||||
# Load MusicBrainz wrappers
|
||||
. "sh/mb.sh"
|
||||
|
||||
# Load local file handling
|
||||
. "sh/local.sh"
|
||||
|
||||
# Support of local music files
|
||||
if [ "${MUSICDIR:-}" ]; then
|
||||
if [ "${1:-}" = "--decorate" ]; then
|
||||
[ ! "${2:-}" ] && err "You did not specify a directory." && exit 1
|
||||
[ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1
|
||||
if ! decorate "$2"; then
|
||||
err "Something went wrong. Are you're files tagged correctly?"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${1:-}" = "--internal-preview-artist" ]; then
|
||||
__preview_artist "$2"
|
||||
exit 0
|
||||
@@ -177,17 +196,17 @@ if [ "${1:-}" = "--internal-list-releases" ]; then
|
||||
$JQ -r '."artist-credit" | map(([.name, .joinphrase]|join(""))) | join("")')"
|
||||
mb_releasegroup_releases "$2" |
|
||||
$JQ -r '."releases"[] | [
|
||||
.id,
|
||||
.status,
|
||||
.date,
|
||||
."cover-art-archive".count,
|
||||
(."label-info" | map(.label.name) | unique | join(", ")),
|
||||
(.media | map(."track-count") | add),
|
||||
(.media | map(.format) | unique | join(", ")),
|
||||
.country,
|
||||
.title,
|
||||
(."artist-credit" | map(([.name, .joinphrase]|join(""))) | join(""))
|
||||
] | join("\t")' |
|
||||
.id,
|
||||
.status,
|
||||
.date,
|
||||
."cover-art-archive".count,
|
||||
(."label-info" | map(.label.name) | unique | join(", ")),
|
||||
(.media | map(."track-count") | add),
|
||||
(.media | map(.format) | unique | join(", ")),
|
||||
.country,
|
||||
.title,
|
||||
(."artist-credit" | map(([.name, .joinphrase]|join(""))) | join(""))
|
||||
] | join("\t")' |
|
||||
awk \
|
||||
-F "\t" \
|
||||
-v release_official="$FORMAT_STATUS_OFFICIAL" \
|
||||
|
Reference in New Issue
Block a user