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 artdir; do
|
||||||
|
cd "$artdir"
|
||||||
|
# get albums
|
||||||
|
ls -d */ > directories
|
||||||
while read -r dir; do
|
while read -r dir; do
|
||||||
# change into directory
|
# change into directory
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
# create directory in music
|
# create directory in music
|
||||||
mkdir -p "$HOME/Musik/$dir"
|
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"
|
cd "$HOME/MusikRaw/$artdir"
|
||||||
done < directories
|
done < directories
|
||||||
|
# cleanup
|
||||||
# remove directories file
|
|
||||||
rm directories
|
rm directories
|
||||||
|
cd "$HOME/MusikRaw"
|
||||||
|
done < artistdirectories
|
||||||
|
# cleanup
|
||||||
|
rm artistdirectories
|
||||||
|
|
||||||
echo Finished!
|
echo Finished!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user