diff options
| author | appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> | 2022-09-22 12:52:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-22 12:52:04 +0000 |
| commit | 41b729acd303ff1180ca2e1a9ab9e0b05a0e4c29 (patch) | |
| tree | abc8ec7670e4fcfa26e3ceee9ccb10211bcbc301 /.local/bin | |
| parent | 5ff7f70b64214beafc9146717d6a766d721b9786 (diff) | |
| download | eibhear-41b729acd303ff1180ca2e1a9ab9e0b05a0e4c29.tar.gz eibhear-41b729acd303ff1180ca2e1a9ab9e0b05a0e4c29.tar.zst eibhear-41b729acd303ff1180ca2e1a9ab9e0b05a0e4c29.zip | |
Fix tag script mp3 issue (#1182)
* Fix tag script mp3 issue
When you don't manually specify $total and $date with an mp3 file the eyeD3 command tries tagging with an empty variable, which causes it to error. This fixes it by only passing the parameter to the command if the variable is set.
This pull request also adds support for the $genre and $comment variable.
* Remove double backslash
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/tag | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/.local/bin/tag b/.local/bin/tag index 8462b99..11a5b8e 100755 --- a/.local/bin/tag +++ b/.local/bin/tag @@ -54,7 +54,11 @@ Total=$total Date=$date Genre=$genre Comment=$comment" | opustags -i -S "$file" ;; - *.mp3) eyeD3 -Q --remove-all -a "$artist" -A "$album" -t "$title" -n "$track" -N "$total" -Y "$date" "$file" ;; + *.mp3) eyeD3 -Q --remove-all -a "$artist" -t "$title" -A "$album" -n "$track" \ + ${total:+-N "$total"} \ + ${date:+-Y "$date"} \ + ${genre:+-G "$genre"} \ + ${comment:+-c "$comment"} "$file" ;; *.flac) echo "TITLE=$title ARTIST=$artist ALBUM=$album |
