Thank you for providing this Scanner. I use it with my yaVDR Movies directory without any problems.
Because I have a lot of TV Shows and no plan of writing a scanner in python I made a work around for my tv shows.
The PMS internal scanner need a structure like
/Heroes
/Season 1
Heroes - s01e01.avi
Heroes - s01e02.avi
/Season 2
Heroes - s02e01.avi
Heroes - s02e02.mkv
The VDR stores the recordings in a path like:
Serien/Abenteuer/Black_Sails/Season_01/01~03_Unheilige_Allianzen/2014-04-27.20.15.71-0.rec/00001.ts
I have this structure for tv shows since I set up my first VDR years ago. In this path I have all the information I need to create a Plex like path with a single symlink. So I made a pretty basic awk script to create a symlink looking like this
S01E03_Unheilige_Allianzen.ts -> 01~03_Unheilige_Allianzen/2014-04-27.20.15.71-0.rec/00001.ts
The PMS Scanner has now a correct Path to scan
/Black_Sails/Season_01/S01E03_Unheilige_Allianzen.ts
and get the tv show information from the TVDB. I also made another simple scipt to run as a cronjob. I use my yaVDR headless ubuntu 64 bit system ro run the PMS.
The cron script:
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#Use this script with care it maybe delete all your symbolic links or create a hack of symbolic links.
inputFile=/tmp/videofiles
seriesFolder=/srv/vdr/video.00/Serien/
awkScript=/usr/local/bin/createSeriesSyms.awk
Delete all symbolic links - use only to reset the the original VDR structure
find /srv/vdr/video.00/Serien/ -type l -exec rm -rf {} ;
Delete all symbolic dead links in the series folder
echo “CSS: Deleteing old symbolic links”
find -L $seriesFolder -type l -exec rm -rf {} ;
find all 0001.ts files in the series folder and put it into die inputFile
echo “CSS: Searching for videofiles”
find $seriesFolder -name 00001.ts > $inputFile
Call the awk File to create the symbolic links
echo “CSS: Starting the AWK Script”
awk -f $awkScript $inputFile
The awk Script:
#! /usr/bin/awk -f
set the file separator for my series folder.
Example: /srv/vdr/video.00/Serien/Crime/Banshee:_Small_Town._Big_Secrets./Season_02/02~05_Die_Wahrheit_über_Einhörner/2014-05-15.22.05.38-0.rec/00001.ts
so the separator here is the / for the normal file structure and the ~ for my season and episode
If you want to use this script you have to specify your own separators.
BEGIN{
FS="[/|~]*";
}
{
#print FILENAME;
#f=FILENAME;
}
{
# Because the result of the find command does not have any escaped chars I use gsub to escape special characters.
# There maybe some characters more. They can be added by a another gsub command
gsub(/:/,":");
gsub(/(/,"(");
gsub(/)/,")");
gsub(/’/,"’");
#This combination will only work for MY structure of folders. If you want to use this you have to determine your own structure.
#The example from the top will look like:
#$0 /srv/vdr/video.00/Serien/Crime/Banshee:_Small_Town._Big_Secrets./Season_02/02~05_Die_Wahrheit_über_Einhörner/2014-05-15.22.05.38-0.r$
#$1
#$2 srv
#$3 vdr
#$4 video.00
#$5 Serien
#$6 Crime
#$7 Banshee:_Small_Town._Big_Secrets.
#$8 Season_02
#$9 02
#$10 05_Die_Wahrheit_über_Einhörner
#$11 2014-05-15.22.05.38-0.rec
#$12 00001.ts
#This results in: ln -s 02~05_Die_Wahrheit_über_Einhörner/2014-05-15.22.05.38-0.rec/00001.ts /srv/vdr/video.00/Serien/Crime/Banshee\:_Small_Town._Bi$
#For Testing you can use the print statement
#print("ln -s " $9"~"$10"/"$11"/"$12" ""/"$2"/"$3"/"$4"/"$5"/"$6"/"$7"/"$8"/""S"$9"E"$10".ts");
system("ln -s " $9"~"$10"/"$11"/"$12" ""/"$2"/"$3"/"$4"/"$5"/"$6"/"$7"/"$8"/""S"$9"E"$10".ts");
# With this you can get your own variables
#for (i=0;i<15;i++)
#{
#print ("Field "i" "$i);
#}
}
This scripts are only working if you have a single ts file 00001.ts. I had a lot of old recordings with more than one ts file. So I made another simple script to join all ts files to one 00001.ts.
#!/bin/bash
find "/srv/vdr/video.00/" -path "/srv/vdr/video.00/Serien/*" -prune -o -name 00002.ts -exec dirname {} \; | sort -u > tsfiles
PFADE=$(cat tsfiles)
for f in $PFADE
do
echo $f
add every 0000x.ts file to the 00001.ts file
cat $f/00002.ts $f/00003.ts $f/00004.ts $f/00005.ts >> $f/00001.ts
rm $f/00002.ts $f/00003.ts $f/00004.ts $f/00005.ts
done
So the scripts are bretty basic but I do not have enough time nor the knowlege to make it much better. I also know that thsi is now scanner for VDR TV Shows but if you search for a solution of this problem you can use this way till somebody who is good in python creates a real Scanner. I can say that this script is working without any Problems on my System. Sure you have to adapt it to your own file structure but I think that should not be a problem.
Ciao
Wyse