add metflac scripts
This commit is contained in:
parent
d071d42abf
commit
6a9291bbaa
2 changed files with 42 additions and 0 deletions
18
add_compilation_tag-metaflac.sh
Executable file
18
add_compilation_tag-metaflac.sh
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Funktion zum Hinzufügen des Tags zu einer .flac-Datei
|
||||||
|
add_tag() {
|
||||||
|
local file="$1"
|
||||||
|
metaflac --remove-tag=COMPILATION "$file"
|
||||||
|
metaflac --set-tag=COMPILATION=1 "$file"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Finde alle .flac-Dateien rekursiv und füge das Tag hinzu
|
||||||
|
find . -type f -name "*.flac" -print0 | while IFS= read -r -d '' file; do
|
||||||
|
echo "Processing file: $file"
|
||||||
|
add_tag "$file"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Done."
|
24
add_replay_gain-metaflac.sh
Executable file
24
add_replay_gain-metaflac.sh
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Funktion zum Hinzufügen von Replay Gain zu einer einzelnen Datei
|
||||||
|
add_replay_gain() {
|
||||||
|
local file="$1"
|
||||||
|
echo "Processing $file"
|
||||||
|
metaflac --add-replay-gain "$file"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Funktion zum rekursiven Durchsuchen von Verzeichnissen
|
||||||
|
process_directory() {
|
||||||
|
local dir="$1"
|
||||||
|
find "$dir" -type f -name "*.flac" -print0 | while IFS= read -r -d '' file; do
|
||||||
|
add_replay_gain "$file"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Startverzeichnis (Standardmäßig das aktuelle Verzeichnis)
|
||||||
|
start_dir="${1:-.}"
|
||||||
|
|
||||||
|
# Verzeichnis verarbeiten
|
||||||
|
process_directory "$start_dir"
|
Loading…
Reference in a new issue