Change to new folder structure
This commit is contained in:
parent
a75b240ba1
commit
9c6008e7f1
@ -8,31 +8,38 @@ rm -rf "$HOME/Musik/"*
|
|||||||
cd "$HOME/MusikRaw"
|
cd "$HOME/MusikRaw"
|
||||||
|
|
||||||
# get directories
|
# get directories
|
||||||
ls -d */ > directories
|
ls -d */ > artistdirectories
|
||||||
|
|
||||||
while read -r dir; do
|
while read -r artdir; do
|
||||||
# change into directory
|
cd "$artdir"
|
||||||
cd "$dir"
|
# get albums
|
||||||
# create directory in music
|
ls -d */ > directories
|
||||||
mkdir -p "$HOME/Musik/$dir"
|
while read -r dir; do
|
||||||
|
# change into directory
|
||||||
|
cd "$dir"
|
||||||
|
# create directory in music
|
||||||
|
mkdir -p "$HOME/Musik/${artdir}/$dir"
|
||||||
|
|
||||||
# link cover.jpg
|
# link cover.jpg
|
||||||
if [[ -f cover.jpg ]]; then
|
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
|
fi
|
||||||
|
|
||||||
# make symbolic link to music
|
# make symbolic link to music
|
||||||
# if the "normalized" directory exists, links are created
|
# if the "normalized" directory exists, links are created
|
||||||
if [[ -d "normalized" ]]; then
|
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
|
fi
|
||||||
|
|
||||||
# go back to music raw
|
# go back to music raw
|
||||||
|
cd "$HOME/MusikRaw/$artdir"
|
||||||
|
done < directories
|
||||||
|
# cleanup
|
||||||
|
rm directories
|
||||||
cd "$HOME/MusikRaw"
|
cd "$HOME/MusikRaw"
|
||||||
done < directories
|
done < artistdirectories
|
||||||
|
# cleanup
|
||||||
# remove directories file
|
rm artistdirectories
|
||||||
rm directories
|
|
||||||
|
|
||||||
echo Finished!
|
echo Finished!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user