summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshipwreckt <me@shipwreckt.co.uk>2025-06-14 15:15:09 +0100
committershipwreckt <me@shipwreckt.co.uk>2025-06-14 15:15:09 +0100
commitc9e7170faff3e352eef5619dedf7a12e68ca610d (patch)
treeba6b562a3396fba855e21cebf8ad3bc10ee7a8f0
parent95f2b4fc84a99b477df34fc827fa1936ab84f401 (diff)
Old MPD scrips I made that I did not add beforeHEADmaster
-rw-r--r--files/config/mpd/database0
-rw-r--r--files/config/mpd/mpd.log0
-rw-r--r--files/config/mpd/mpdconf.example2
-rw-r--r--files/config/mpd/pid0
-rw-r--r--files/config/mpd/scripts/album.sh30
-rwxr-xr-xfiles/config/mpd/scripts/album1.sh31
-rwxr-xr-xfiles/config/mpd/scripts/artist.sh13
-rwxr-xr-xfiles/config/mpd/scripts/cap.sh22
8 files changed, 98 insertions, 0 deletions
diff --git a/files/config/mpd/database b/files/config/mpd/database
deleted file mode 100644
index e69de29..0000000
--- a/files/config/mpd/database
+++ /dev/null
diff --git a/files/config/mpd/mpd.log b/files/config/mpd/mpd.log
deleted file mode 100644
index e69de29..0000000
--- a/files/config/mpd/mpd.log
+++ /dev/null
diff --git a/files/config/mpd/mpdconf.example b/files/config/mpd/mpdconf.example
index 4121992..0c757fc 100644
--- a/files/config/mpd/mpdconf.example
+++ b/files/config/mpd/mpdconf.example
@@ -1,6 +1,8 @@
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
+# Note from Shipwreckt:
+# Left this here just in case.
# Files and directories #######################################################
#
diff --git a/files/config/mpd/pid b/files/config/mpd/pid
deleted file mode 100644
index e69de29..0000000
--- a/files/config/mpd/pid
+++ /dev/null
diff --git a/files/config/mpd/scripts/album.sh b/files/config/mpd/scripts/album.sh
new file mode 100644
index 0000000..b705f3e
--- /dev/null
+++ b/files/config/mpd/scripts/album.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Path to your music directory
+music_dir="Music/Dead_Kennedys"
+
+# Loop through all FLAC files in the directory and its subdirectories
+find "$music_dir" -type f -name "*.flac" | while read -r file; do
+ # Extract the current ALBUM metadata
+ raw_album=$(metaflac --show-tag=ALBUM "$file")
+
+ # Check if the ALBUM tag exists
+ if [[ "$raw_album" == ALBUM=* ]]; then
+ # Extract the actual album name
+ album_name=$(echo "$raw_album" | sed 's/^ALBUM=//')
+
+ # Format the album name: capitalize the first letter of each word
+ capitalized_album=$(echo "$album_name" | sed -e 's/\b\(.\)/\U\1/g')
+
+ # Remove the original ALBUM tag
+ metaflac --remove-tag=ALBUM "$file"
+
+ # Set the new ALBUM tag with the properly capitalized name
+ metaflac --set-tag=ALBUM="$capitalized_album" "$file"
+
+ echo "Updated album metadata for: $file -> $capitalized_album"
+ else
+ echo "No ALBUM metadata found for: $file"
+ fi
+done
+
diff --git a/files/config/mpd/scripts/album1.sh b/files/config/mpd/scripts/album1.sh
new file mode 100755
index 0000000..171011a
--- /dev/null
+++ b/files/config/mpd/scripts/album1.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Script for changing specific album names.
+
+# Path to the specific album directory
+album_dir=""
+
+# The desired album name for these files
+album_name=""
+
+# Loop through all FLAC files in the directory
+find "$album_dir" -type f -name "*.flac" | while read -r file; do
+ # Extract the current ALBUM metadata
+ raw_album=$(metaflac --show-tag=ALBUM "$file")
+
+ # Check if the ALBUM tag exists
+ if [[ "$raw_album" == ALBUM=* ]]; then
+ echo "Updating existing ALBUM metadata for: $file"
+ else
+ echo "No ALBUM metadata found for: $file. Adding ALBUM tag."
+ fi
+
+ # Remove the existing ALBUM tag (if it exists)
+ metaflac --remove-tag=ALBUM "$file"
+
+ # Set the new ALBUM tag with the desired name
+ metaflac --set-tag=ALBUM="$album_name" "$file"
+
+ echo "Updated ALBUM metadata for: $file -> $album_name"
+done
+
diff --git a/files/config/mpd/scripts/artist.sh b/files/config/mpd/scripts/artist.sh
new file mode 100755
index 0000000..bcf0508
--- /dev/null
+++ b/files/config/mpd/scripts/artist.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# Define the directory containing your music files
+MUSIC_DIR="Music/Dead_Kennedys/Dead_Kennedys_-_Give_Me_Convenience_Or_Give_Me_Death"
+# Define the new artist name
+NEW_ARTIST="Dead Kennedys"
+
+# Loop through all .flac files in the folder
+for song in "$MUSIC_DIR"/*.flac; do
+ # Update the artist metadata for each file
+ metaflac --remove-tag=ARTIST "$song"
+ metaflac --set-tag=ARTIST="$NEW_ARTIST" "$song"
+done
+
diff --git a/files/config/mpd/scripts/cap.sh b/files/config/mpd/scripts/cap.sh
new file mode 100755
index 0000000..62d1944
--- /dev/null
+++ b/files/config/mpd/scripts/cap.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Path to your music directory
+music_dir="Music/Dead_Kennedys/Dead_Kennedys_-_Give_Me_Convenience_Or_Give_Me_Death"
+
+# Loop through all FLAC files in the directory (sorted by name)
+find "$music_dir" -type f -name "*.flac" | sort | while read -r file; do
+ # Extract the base filename without extension
+ base_name=$(basename "$file" .flac)
+
+ # Format the title by replacing underscores with spaces and capitalizing the first letters
+ title=$(echo "$base_name" | sed -e 's/_/ /g' -e 's/^\(.\)/\U\1/' -e 's/\b\(.\)/\U\1/g')
+
+ # Remove the original TITLE tag
+ metaflac --remove-tag=TITLE "$file"
+
+ # Set the new TITLE tag
+ metaflac --set-tag=TITLE="$title" "$file"
+
+ echo "Updated title for: $file -> $title"
+done
+