Posts: 9
Joined: Nov 2008
Reputation:
0
To all, I have all my movies in one folder and I would like to do fanart and the like with .nfo files. Does anyone have a bash script that will run through all the movies and create a folder of the same name and move the file into that folder. I thought I saw a thread in here before but I could not find it anywhere. Thanks in advance.
Posts: 1,741
Joined: Jul 2006
Reputation:
4
Look, that program was a pretty decent undertaking and sorely needed. Yeah, it's Windows based because the programmer who did it apparently knew VB and he scratched an itch that many had - including myself. So far no one else has built anything like it that I'm aware of and the program works well enough to have handled almost 800 movies and a pile of TV shows on my system. It's a bit more than a bash script to say the least and so far no one seems to have done the same in Linux. Would you have preferred if the answer to the question was simply "NO, nothing exists" or was pointing to a Windows based program a better answer? I know what my preference is....
Posts: 9
Joined: Nov 2008
Reputation:
0
I am planning on using something like that to propagate the folders with info. I need a script that will take the movie, create a folder with the same name and then move that avi file into that folder.
Example
somemovie.avi
create folder somemovie
move somemovie.avi to somemovie folder.
I can then use media companion to finish off the rest.
Posts: 2
Joined: Nov 2009
Reputation:
0
I've pretty much copied what others did... I'm by no means any kind of expert at scripting:
#!/bin/sh
echo "This script moves videos and other file from the folder passed into a subdirectory with the filename"
if [ -z "$1" ]; then
echo "Usage: $0 <moviedir>"
exit 1
fi
for ext in .avi .xvid .divx .mov
do
find "$1" -maxdepth 1 \( -name \*$ext \) -type f | while read m; do
dir=`basename "$m" $ext`
if [ ! -d "$1/$dir" ]; then
echo "Moving $m"
mkdir "$1/$dir" -m 0755
fi
find "$1" \( -name "$dir.*" -o -name "$dir-fanart.jpg" \) -type f -print0 | xargs -0 mv -t "$1/$dir/"
done
done