From 1ac5d8dcb5e1fb78504adffef1ec0857340459dc Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Tue, 28 Jul 2015 00:49:31 +0000
Subject: google-chrome: update to 44.0.2403.107

---
 abs/core/mythtv/stable-0.27/mythtv/recordings | 91 ++++++++++++++++++++++++++-
 abs/extra/google-chrome/PKGBUILD              |  6 +-
 2 files changed, 93 insertions(+), 4 deletions(-)

diff --git a/abs/core/mythtv/stable-0.27/mythtv/recordings b/abs/core/mythtv/stable-0.27/mythtv/recordings
index 7fdde51..382fc4c 100644
--- a/abs/core/mythtv/stable-0.27/mythtv/recordings
+++ b/abs/core/mythtv/stable-0.27/mythtv/recordings
@@ -1,5 +1,94 @@
 #!/bin/bash
+
+#START=$(date +%s)
+
+#check if mythbackend is running and was just started
+for i in 1 2
+do
+if [ `cat /etc/sv/mythbackend/supervise/pid` ]
+then
+    now=$(date +%s)
+    mythbackendStartTime=`stat -c %Y /etc/sv/mythbackend/supervise/pid`
+    if [[ $(( $now - $mythbackendStartTime )) -lt 59 ]]
+    then
+        #echo "mythbackend started less than a minute ago. Sleeping..."
+        sleep 60
+    fi
+else
+    #echo "mythbackend not running. exiting."
+    exit
+fi
+done
+
 if [ -f /usr/share/mythtv/contrib/user_jobs/mythlink.pl ]
 then
-    su - mythtv -c "perl /usr/share/mythtv/contrib/user_jobs/mythlink.pl --link /data/storage/disk0/media/recordings"
+    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'"
+
+    #delete Deleted recgroup and move files out of other dirs
+    if [ -d "$tmprecdir/Deleted" ]
+    then
+        rm -r "$tmprecdir/Deleted"
+    fi
+    #move all links in recgroup dirs out to tmprecdir
+    for recgroup in $tmprecdir/*
+    do
+        if [ -d "$recgroup" ]
+        then
+            rsync -a "$recgroup/" "$tmprecdir"
+            rm -r "$recgroup"
+        fi
+    done
+    #replace SE if no season/episode is in myth
+    for link in $tmprecdir/**/*\ -\ SE\ -\ *
+    do
+        newlink=`echo "$link" | sed 's/ - SE - / - /'`
+        mv "$link" "$newlink"
+    done
+    #replace SEyy if no season is in myth
+    for link in $tmprecdir/**/*\ -\ SE[0-9][0-9]\ -\ *
+    do
+        newlink=`echo "$link" | sed 's/ - SE/ - S00E/'`
+        mv "$link" "$newlink"
+    done
+    #replace SyyE if no episode is in myth
+    for link in $tmprecdir/**/*\ -\ S[0-9][0-9]E\ -\ *
+    do
+        newlink=`echo "$link" | sed 's/E - /E00 - /'`
+        mv "$link" "$newlink"
+    done
+    #replace blank original date
+    for link in $tmprecdir/**/*\ -\ 0000-00-00\ -\ *
+    do
+        newlink=`echo "$link" | sed 's/ - 0000-00-00 - / - /'`
+        mv "$link" "$newlink"
+    done
+
+    #change symlinks mtime to match the file it is linked to
+#    for link in $tmprecdir/**/*
+#    do
+#        if [ -L "$link" ]
+#        then
+#            file=`readlink "$link"`
+#            touch -hr "$file" "$link"
+#        fi
+#    done
+
+    #sync tmprecdir to recdir
+    #rsync -aOP --delete --ignore-existing "$tmprecdir/" "$recdir/"
+    rsync -aOP --delete "$tmprecdir/" "$recdir/"
+
+    #check if plex media server is running
+    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 --scan --refresh --section $line
+        done
+    fi
 fi
+
+#END=$(date +%s)
+#DIFF=$(( $END - $START ))
+#echo "It took $DIFF seconds"
diff --git a/abs/extra/google-chrome/PKGBUILD b/abs/extra/google-chrome/PKGBUILD
index 2374ca2..0e5109e 100644
--- a/abs/extra/google-chrome/PKGBUILD
+++ b/abs/extra/google-chrome/PKGBUILD
@@ -5,7 +5,7 @@
 # or use: $ curl -s https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | gzip -df | awk -F\" '/pkgid/{ sub(".*-","",$4); print $4": "$10 }'
 
 pkgname=google-chrome
-pkgver=43.0.2357.134
+pkgver=44.0.2403.107
 pkgrel=1
 pkgdesc="An attempt at creating a safer, faster, and more stable browser (Stable Channel)"
 arch=('i686' 'x86_64')
@@ -24,8 +24,8 @@ source=('eula_text.html')
 source_i686=("google-chrome-${_channel}_${pkgver}_i386.deb::https://dl.google.com/linux/direct/google-chrome-${_channel}_current_i386.deb")
 source_x86_64=("google-chrome-${_channel}_${pkgver}_amd64.deb::https://dl.google.com/linux/direct/google-chrome-${_channel}_current_amd64.deb")
 md5sums=('b7e752f549b215ac77f284b6486794b6')
-md5sums_i686=('9a806fa944c59ce398b13c8c79bca123')
-md5sums_x86_64=('b26558f6be7834d36a58e70348082203')
+md5sums_i686=('5def5b68903390d7c309c81afb603084')
+md5sums_x86_64=('79720c74f7616b3c06b1af42776bb79d')
 
 package() {
   msg2 "Extracting the data.tar.lzma..."
-- 
cgit v0.12

