From 7ff9923113b6d3cf84501412d3604dcbdae61bb3 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Wed, 30 Apr 2025 02:35:47 +0200 Subject: [PATCH] Setup --- lib/setup/source | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/lib/setup/source b/lib/setup/source index 03c2c5a..44ec5e6 100644 --- a/lib/setup/source +++ b/lib/setup/source @@ -55,4 +55,58 @@ setupSource() { done unset count cd - >/dev/null + cat <<-EODesc + + Tag guessing pattern: + This is a pattern that will be used to guess the tag names of files + that do not have any tags. The pattern is a string with the following + variables: + %{album} - The album name + %{albumartist} - The album artist name + %{artist} - The artist name + %{disc} - The disc number - 1 digit + %{genre} - The genre name + %{releasecountry} - The country of the release - 2 letter code + %{title} - The title of the track + %{track} - The track number - 2 digits + %{year} - The year or date of the album + EODesc + read \ + -e \ + -i"${tagguessing} \ + -p'Pattern: ' \ + tagguessing + cat <<-EODesc + + Tag guessing trigger(s): + Tags whose absence will trigger tag guessing. + album - The album name + albumartist - The album artist name + artist - The artist name + disc - The disc number + genre - The genre name + releasecountry - The country of the release + title - The title of the track + track - The track number + year - The year or date of the album + EODesc + count=${#tagguessingtriggers[@]} + for (( i=0 ; 1 ; i++ )) + do + read \ + -e \ + ${tagguessingtriggers[i]+-i"${tagguessingtriggers[i]}"}\ + -p'Tag guessing trigger: ' \ + value + if [ -n "$value" ] + then + tagguessingtriggers[i]="$value" + elif (( i < count )) + then + unset tagguessingtriggers[i] + else + break + fi + done + unset count }