summaryrefslogtreecommitdiffstats
path: root/abs/core/mythtv/stable-0.27/mythtv/recordings
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/mythtv/stable-0.27/mythtv/recordings')
-rw-r--r--abs/core/mythtv/stable-0.27/mythtv/recordings22
1 files changed, 20 insertions, 2 deletions
diff --git a/abs/core/mythtv/stable-0.27/mythtv/recordings b/abs/core/mythtv/stable-0.27/mythtv/recordings
index e364f3c..984fea9 100644
--- a/abs/core/mythtv/stable-0.27/mythtv/recordings
+++ b/abs/core/mythtv/stable-0.27/mythtv/recordings
@@ -24,7 +24,8 @@ if [ -f /usr/share/mythtv/contrib/user_jobs/mythlink.pl ]
then
recdir="/data/storage/disk0/media/recordings"
tmprecdir="/data/storage/disk0/media/tmp/recordings"
- su - mythtv -c "perl /usr/share/mythtv/contrib/user_jobs/mythlink.pl --format '%U/%T/%T %- S%ssE%ep %- %oY-%om-%od %- %S' --link '$tmprecdir'"
+ rm -r $tmprecdir
+ su - mythtv -c "perl /usr/share/mythtv/contrib/user_jobs/mythlink.pl --format '%U/%T/%T %- S%ssE%ep %- %oY-%om-%od = %S' --link '$tmprecdir'"
#delete Deleted recgroup and move files out of other dirs
if [ -d "$tmprecdir/Deleted" ]
@@ -64,6 +65,22 @@ then
newlink=`echo "$link" | sed 's/ - 0000-00-00 - / - /'`
mv "$link" "$newlink"
done
+ #add dash pt suffix if filename before the subtitle is the same
+ #so that plex will scan and include in library
+ uniqs="$(ls $tmprecdir/**/* | sed 's/ = .*//' | sort | uniq -d)"
+ SAVEIFS=$IFS
+ IFS=$'\n'
+ for link in $uniqs
+ do
+ i=1
+ for dup in `ls -v $link*`
+ do
+ newlink=`echo "$dup" | sed "s/ = /-pt$i = /"`
+ mv "$dup" "$newlink"
+ i=$((i+1))
+ done
+ done
+ IFS=$SAVEIFS
#change symlinks mtime to match the file it is linked to
# for link in $tmprecdir/**/*
@@ -83,7 +100,8 @@ then
if [[ `pidof "Plex Media Server"` ]]
then
#get plex section and update
- /usr/LH/bin/plexmediascanner.sh -l | grep -i myth | cut -d: -f1 | while read -r line ; do
+ /usr/LH/bin/plexmediascanner.sh -l | grep -i myth | cut -d: -f1 | while read -r line
+ do
/usr/LH/bin/plexmediascanner.sh --scan --refresh --section $line
done
fi