-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tool: Multi-file structure creator #427
Comments
VITA3K NOTE: the same can be valid for PS3 as well as they're using a very similar system. |
Proto script that I did, it worked very well with my collection: #!/bin/bash
# Function to create multidisk directories
create_multidisk_directories() {
echo "Checking for games with multiple .chd files..."
# Loop through each file in the current directory
for file in *; do
# Check if file name contains Disc/Disk/CD
if [[ "$file" =~ (Disc|Disk|CD) ]]; then
echo "Found game with possible multidisk: $file"
# Get base name without (Disc X) part
base_name=$(echo "$file" | sed -E 's/ \(Disc [0-9]+\)\.chd//')
# Create a directory for the game
mkdir -p "$base_name.m3u"
# Move the files into the game directory
mv "$file" "$base_name.m3u/"
mv "${base_name}*(Disc|Disk|CD)*.chd" "$base_name.m3u/"
# Change directory to the game directory
cd "$base_name.m3u" || exit
# Create the .m3u file
touch "${base_name}.m3u"
# Write unique .chd file names to .m3u file
for chd_file in *.chd; do
if ! grep -q "$chd_file" "${base_name}.m3u"; then
echo "$chd_file" >> "${base_name}.m3u"
fi
done
echo "Multidisk directory created for: $base_name"
# Move back to original directory
cd ..
else
echo "Skipping $file, does not contain Disc/Disk/CD in filename."
fi
done
echo "Multidisk directories creation complete."
}
# Call function to create multidisk directories
create_multidisk_directories |
Duplicate of: #286 |
The goal of this tool is that is checks if roms in a selected roms folder and tries to create a multi-file structure of multiple file or disc games.
So it creates the file structure, moves the roms into a subfolder.m3u and the create the m3u textfile.
The text was updated successfully, but these errors were encountered: