3 ms·
Just a jq wrapper that adds -e and includes some functions $ cat ~/bin/jqmusic #!/usr/bin/env bash exec jq -e "${@:1:$(($#-2))}" "include \"music\"; $
by BoingBoomTschak 2y ago
Just a jq wrapper that adds -e and includes some functions
$ cat ~/bin/jqmusic
#!/usr/bin/env bash
exec jq -e "${@:1:$(($#-2))}" "include \"music\"; ${@: -2:1}" "${@: -1}" >/dev/null 2>&1
$ cat ~/.jq/music.jq
def year: .released | match("[0-9]{4}").string | tonumber;
def has_genre(str): .genres.primary | any(. == str);
def match_genre(regexp): .genres.primary | any(match(regexp));
Together with https://git.sr.ht/~q3cpma/rymscrap https://git.sr.ht/~q3cpma/rymscrap to get the actual JSON.