Skip to content

Instantly share code, notes, and snippets.

@grahamgilchrist
Created October 21, 2012 19:03
Show Gist options
  • Save grahamgilchrist/3928105 to your computer and use it in GitHub Desktop.
Save grahamgilchrist/3928105 to your computer and use it in GitHub Desktop.
Create XBMC .nfo files from mkvs in directory
root=$(pwd)
movieset=$1
echo $root
for file in $root/*.mkv
do
filepath="${file%.*}.nfo"
filename=$(basename $file)
echo "Processing $filename"
echo "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n" > $filepath
echo "<movie>" >> $filepath
echo " <title>$filename</title>" >> $filepath
echo " <set>$movieset</set>" >> $filepath
echo "</movie>" >> $filepath
echo "Output $filepath"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment