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

Batch convert isos and naming #93

Open
Rebislori opened this issue Sep 8, 2024 · 3 comments
Open

Batch convert isos and naming #93

Rebislori opened this issue Sep 8, 2024 · 3 comments
Labels
question Further information is requested xdvdfs-cli Relating to the xdvdfs command-line frontend

Comments

@Rebislori
Copy link

Hi everyone, and thank you for this project.
I must say that i know my way around computers, i have my linux basics, but templating and scripting are well over my possibilities.

I'm setting up pegasus with metadata and whatnot, but all my xbox games are in iso format, not xiso.

I solved this with sdvdgs-cli: "./xdvdfs pack /dir/to/the/image.iso /dir/to/the/converted/image.iso

I have 2 questions:

1)is there a way i can automatically create the xiso with the same name as the original iso?
2)Is there a way to batch convert isos? Or, at least, could anyone point me in the right direction?

Thanks again!

@astarivi
Copy link
Contributor

To answer both of your questions:

  1. By omitting the output path, the output image will be created in the same folder as the source, with a ".xiso.iso" extension.
  2. There is no current way to do this natively. A script would help with this.

Batch processing sounds like a good idea, I propose creating a new CLI command "batch" that takes an extra parameter, "pack" or "unpack", then two paths, input and output folder.

@antangelo
Copy link
Owner

Some additional notes:

  1. When an output path is not provided, the output will be in the current working directory. We first try <filename>.iso, and if that already exists and is equal to the input path, then we use <filename>.xiso.iso. If your output directory is different from the source directory, you can achieve output with the same filename by running xdvdfs pack from inside the output directory, with no output argument.
  2. You don't necessarily need a script to perform batching, you can use the find command with -exec to execute a command on every file in a directory that matches some criteria given in the arguments.

I'm open to the idea of adding some sort of native batching support but it needs to offer some benefit over find -exec or similar. At minimum it should run operations in parallel, which requires changing the current async executor (probably to tokio).

@antangelo antangelo added question Further information is requested xdvdfs-cli Relating to the xdvdfs command-line frontend labels Sep 13, 2024
@gmipf
Copy link

gmipf commented Oct 17, 2024

I have written 2 bash scripts for batch processing, input is your folder where all ISOs resides, output is the folder where to extract or repack. Don't forget to add the "/" at the end of the path or the script will break.
Repack script will output with your filename.xiso.iso.
Extract script will output to a directory with you filename without the .iso extension.

Batch repack:

#!/bin/bash

input="_OGISO/"
output="_OGXISO/"

shopt -s nullglob # enable nullglob
for file in "$input"*.iso; do
    noniso=${file%.iso} # remove .iso extension
    filename=${noniso/#$input} # remove input prefix from filename
    xdvdfs pack "$file" "$output""$filename".xiso.iso
done
shopt -u nullglob # disable nullglob

echo ""
echo "...done"

Batch extract:

#!/bin/bash

input="_OGISO/"
output="_OG/"

shopt -s nullglob # enable nullglob
for file in "$input"*.iso; do
    noniso=${file%.iso} # remove .iso extension
    folder=${noniso/#$input} # remove input prefix from foldername
    xdvdfs unpack "$file" "$output""$folder"
done
shopt -u nullglob # disable nullglob

echo ""
echo "...done"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested xdvdfs-cli Relating to the xdvdfs command-line frontend
Projects
None yet
Development

No branches or pull requests

4 participants