make NFO from files
by Klapvogn from LinuxQuestions.org on (#58CAC)
Hello,
Im new to all this linux and bash scripting (the script im posting is not made by me)
i have some movies that dosn't have any NFO and i would like to store a NFO inside the dir where the movie is located.
the script i have only makes a default nfo with not much content, and would like it to store some info from mediainfo. Like the basic store width / height / runtime.
if i read this part correct, then the mediainfo stuff should go under the else statement. but thats as fare as my knowlegde goes. So im asking for some help here :)
Code:# SET NFO FILES
if [[ $(find ${incoming} -maxdepth 1 -iname \*.nfo | wc -l ) -gt 0 ]]; then
nfo=$(echo $(find ${incoming} -maxdepth 1 -iname \*.nfo))
echo NFO Exists $(basename "${nfo}") | tee -a log.txt
timestamp=$(date +%s)
cp "${nfo}" ${timestamp}.nfo
nfo=" --form nfo=@${timestamp}.nfo"
echo "${nfo}" | tee -a log.txt
else
echo "No NFO found for release ${name}" | tee -a log.txt
#nfo=" --form nfo=@${defaultnfo}"
fii have tried with this to:
added it under '#nfo=" --form nfo=@${defaultnfo}"'
but i think its a bit much to find all *.mkv
Code:cd /storage/movies/
find -name *.mkv -execdir mediainfo --LogFile={}.nfo {} \;


Im new to all this linux and bash scripting (the script im posting is not made by me)
i have some movies that dosn't have any NFO and i would like to store a NFO inside the dir where the movie is located.
the script i have only makes a default nfo with not much content, and would like it to store some info from mediainfo. Like the basic store width / height / runtime.
if i read this part correct, then the mediainfo stuff should go under the else statement. but thats as fare as my knowlegde goes. So im asking for some help here :)
Code:# SET NFO FILES
if [[ $(find ${incoming} -maxdepth 1 -iname \*.nfo | wc -l ) -gt 0 ]]; then
nfo=$(echo $(find ${incoming} -maxdepth 1 -iname \*.nfo))
echo NFO Exists $(basename "${nfo}") | tee -a log.txt
timestamp=$(date +%s)
cp "${nfo}" ${timestamp}.nfo
nfo=" --form nfo=@${timestamp}.nfo"
echo "${nfo}" | tee -a log.txt
else
echo "No NFO found for release ${name}" | tee -a log.txt
#nfo=" --form nfo=@${defaultnfo}"
fii have tried with this to:
added it under '#nfo=" --form nfo=@${defaultnfo}"'
but i think its a bit much to find all *.mkv
Code:cd /storage/movies/
find -name *.mkv -execdir mediainfo --LogFile={}.nfo {} \;