Skip to content
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

Closed
Lazorne opened this issue Jun 16, 2023 · 3 comments
Closed

Tool: Multi-file structure creator #427

Lazorne opened this issue Jun 16, 2023 · 3 comments
Assignees
Labels
Configurator 🧰 The issue / suggestion is in the configurator. Duplicate 👭🏿 This issue or pull request already exists Enhancement 🪄 Any new feature request or suggestion

Comments

@Lazorne
Copy link
Collaborator

Lazorne commented Jun 16, 2023

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.

@Lazorne Lazorne added Enhancement 🪄 Any new feature request or suggestion Configurator 🧰 The issue / suggestion is in the configurator. labels Jun 16, 2023
@XargonWan
Copy link
Owner

VITA3K
The user configuration for Vita3K is found in ux0/user/## folder, so if we want to really have different users we need to parse the user.xml file and edit it accordignly as any user got its files.
At the moment exists only one user called RetroDECK.

NOTE: the same can be valid for PS3 as well as they're using a very similar system.
And probably other operative-system based emulators as well such as Xbox, Wii, WiiU and Switch may need to be taken care similarly.

@XargonWan XargonWan mentioned this issue Oct 9, 2023
18 tasks
@Lazorne Lazorne added this to the 0.9.0b milestone Jan 26, 2024
@XargonWan
Copy link
Owner

XargonWan commented Mar 21, 2024

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

@XargonWan XargonWan added the Duplicate 👭🏿 This issue or pull request already exists label May 8, 2024
@XargonWan
Copy link
Owner

Duplicate of: #286

@XargonWan XargonWan removed this from the 0.9.0b milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Configurator 🧰 The issue / suggestion is in the configurator. Duplicate 👭🏿 This issue or pull request already exists Enhancement 🪄 Any new feature request or suggestion
Projects
None yet
Development

No branches or pull requests

3 participants