Change to new folder structure

This commit is contained in:
RealStickman 2021-02-12 14:30:17 +01:00
parent a75b240ba1
commit 9c6008e7f1

View File

@ -8,31 +8,38 @@ rm -rf "$HOME/Musik/"*
cd "$HOME/MusikRaw"
# get directories
ls -d */ > directories
ls -d */ > artistdirectories
while read -r artdir; do
cd "$artdir"
# get albums
ls -d */ > directories
while read -r dir; do
# change into directory
cd "$dir"
# create directory in music
mkdir -p "$HOME/Musik/$dir"
mkdir -p "$HOME/Musik/${artdir}/$dir"
# link cover.jpg
if [[ -f cover.jpg ]]; then
ln -vf "$HOME/MusikRaw/$dir/cover."* "$HOME/Musik/$dir/"
ln -vf "$HOME/MusikRaw/${artdir}/$dir/cover."* "$HOME/Musik/${artdir}/$dir/"
fi
# make symbolic link to music
# if the "normalized" directory exists, links are created
if [[ -d "normalized" ]]; then
ln -svf "$HOME/MusikRaw/$dir/normalized/"* "$HOME/Musik/$dir/"
ln -svf "$HOME/MusikRaw/${artdir}/$dir/normalized/"* "$HOME/Musik/${artdir}/$dir/"
fi
# go back to music raw
cd "$HOME/MusikRaw"
cd "$HOME/MusikRaw/$artdir"
done < directories
# remove directories file
# cleanup
rm directories
cd "$HOME/MusikRaw"
done < artistdirectories
# cleanup
rm artistdirectories
echo Finished!