PDA

View Full Version : [LINUX] Add VDR recordings to library (python script)


uxtuner
2009-05-22, 16:15
Here is a little script that generates the necessary files:


#!/bin/bash

VDRREC="/mnt/nas/videos/vdr"
TVFILE="../tvshow.nfo"

for i in $(find $VDRREC -name info.vdr)
do
VDRDIR=$(dirname $i)
VDRFILE=$(basename $i)
cd $VDRDIR

if [ -f info.vdr ];then
TITLE=$(grep "^T " info.vdr | sed "s/^T //")
INHALT=$(grep "^D " info.vdr | sed "s/^D //")
EPISODE=$(grep "^S " info.vdr | sed "s/^S //")
if [ -z "$EPISODE" ];then
EPISODE="$TITLE"
fi
fi

echo "<tvshow>" > $TVFILE
echo "<title>$TITLE</title>" >> $TVFILE
echo "<plot> </plot>" >> $TVFILE
echo "</tvshow>" >> $TVFILE

echo "<episodedetails>" > 001.nfo
echo "<title>$EPISODE</title>" >> 001.nfo
echo "<rating></rating>" >> 001.nfo
echo "<season></season>" >> 001.nfo
echo "<episode></episode>" >> 001.nfo
echo "<plot>$INHALT</plot>" >> 001.nfo
echo "<credits></credits>" >> 001.nfo
echo "<director></director>" >> 001.nfo
echo "<aired></aired>" >> 001.nfo
echo "<actor></actor>" >> 001.nfo
echo "</episodedetails>" >> 001.nfo
done


its quick and dirty, but works - maybe you want to put more features in ...

Gamester17
2009-05-22, 16:32
Maybe should post about that here:
http://xbmc.org/forum/showthread.php?t=36988
and here:
http://xbmc.org/forum/showthread.php?t=45314
...and perhaps here too(?):
http://www.xbmc.org/trac/ticket/5595
...might also be related to this(?):
http://xbmc.org/forum/showthread.php?t=34485

:;):