Page 1 of 1

Creating a DVD structure

Posted: 30 Jul 2018 11:54
by flourgrader
Hi Guys,
I am looking for someone to help me out please.
I know nothing about scripting except I believe only a short bit of script
Is what is required to achieve what I want.
I have 1000 DVDs that have been ripped to Hard Drive.
The path is D:\Films\DVD\vob,bup,ifo
Where Folder DVD is the title of the movie, hence that will have to be a variable in the scrip which changes 1000 times?
I need to create new sub folders in DVD Folder and move files to newly created Folder
Here is an example!
the DVD structures must be complete. Thus, in the folder with the name of the film, you must have a folder "VIDEO_TS" and an empty folder "AUDIO_TS". And all DVD files (.vob, .bup, .ifo ...) must be placed in the "VIDEO_TS" folder.
Any help would be well appreciated
Thank You.
:roll:

Re: Creating a DVD structure

Posted: 30 Jul 2018 12:44
by highend
DVD = Really the name of the movie in the path, e.g. "Avatar"?

TRY THE SCRIPT WITH SOME TEST DVD FOLDERS FIRST!

Code: Select all

    $src = "D:\Films";

    foreach($movie, quicksearch("/nd", $src), <crlf>, "e") {
        if (exists("$movie\AUDIO_TS") == 0) { new("$movie\AUDIO_TS", "dir"); }
        $files = quicksearch("*.bup;*.ifo;*.vob /nf", $movie, "|");
        moveto "$movie\VIDEO_TS", $files, , 2, 2;
    }

Re: Creating a DVD structure

Posted: 30 Jul 2018 16:26
by flourgrader
Thank you very much highend I relay appreciated
You taking the time to write the script.
The script does exactly what I wanted.
I wondered if it could be tweaked?
If the script processes a folder which is empty,
Or has no vob,bup,ifo to move.
The script stops with Error message
“Nothing selected, or what is selected cannot be moved.”
This is the line in the script” moveto "$movie\VIDEO_TS", $files, , 2, 2;”
Command "move"failed or was canceled.
D:\FILMS\SPIDERMAN\VIDEO_TS
Some of my Folders have mixed in them MPEG2 or MPEG4 or AVI films .
I can just ignore those Folders and move onto the next folder.
I wondered if there is a way to move onto the next folder in the script each time it
hits an ERROR so the script does not Stop ?
I know I could press continue in Xyplorer.
Thanks again for your time highend.

Re: Creating a DVD structure

Posted: 30 Jul 2018 16:32
by highend
Do it like this:

Code: Select all

    $src = "D:\Films";

    foreach($movie, quicksearch("/nd", $src), <crlf>, "e") {
        $files = quicksearch("*.bup;*.ifo;*.vob /nf", $movie, "|");
        if (!$files) { continue; }
        if (exists("$movie\AUDIO_TS") == 0) { new("$movie\AUDIO_TS", "dir"); }
        moveto "$movie\VIDEO_TS", $files, , 2, 2;
    }

Re: Creating a DVD structure

Posted: 30 Jul 2018 17:17
by flourgrader
Thank you very much highend .
You are Great.
That does exactly what I want. :D
Have a Good Day...

Re: Creating a DVD structure

Posted: 31 Jul 2018 02:42
by jupe
Yeah it looks like it is un-doing nearly everything from your last script request:

viewtopic.php?f=7&t=13097&p=116077#p116110

:P