summaryrefslogtreecommitdiffstats
path: root/abs/extra/mythappletrailers/gen_trailer_menu.sh
diff options
context:
space:
mode:
authorCecil <knoppmyth@gmail.com>2012-09-17 20:07:21 (GMT)
committerCecil <knoppmyth@gmail.com>2012-09-17 20:07:21 (GMT)
commit2fc10a5c1424f25c1bec90c60b5754550ff5cce7 (patch)
tree4869f5d2d4d5ef84f14f513b1ac6bf78684501c8 /abs/extra/mythappletrailers/gen_trailer_menu.sh
parent5b60b2a21e504020b1724a2c01c5f398b04b8f79 (diff)
downloadlinhes_pkgbuild-2fc10a5c1424f25c1bec90c60b5754550ff5cce7.zip
linhes_pkgbuild-2fc10a5c1424f25c1bec90c60b5754550ff5cce7.tar.gz
linhes_pkgbuild-2fc10a5c1424f25c1bec90c60b5754550ff5cce7.tar.bz2
mythappletrailers:Closes 849. Adds Play All, Shuffle and Play Random trailer to the menu.
Diffstat (limited to 'abs/extra/mythappletrailers/gen_trailer_menu.sh')
-rw-r--r--abs/extra/mythappletrailers/gen_trailer_menu.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/abs/extra/mythappletrailers/gen_trailer_menu.sh b/abs/extra/mythappletrailers/gen_trailer_menu.sh
new file mode 100644
index 0000000..43b2fae
--- /dev/null
+++ b/abs/extra/mythappletrailers/gen_trailer_menu.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+cp /home/mythtv/appletrailer.xml /tmp
+sed -n -e 's/.*<action>\(.*\)<\/action>.*/\1/p' /tmp/appletrailer.xml > /tmp/a.log
+awk < /tmp/a.log '{ print $NF }' > /tmp/b.log
+sort -R /tmp/b.log > /tmp/c.log
+echo "<mythmenu name=\"TRAILERS\">" > /tmp/appletrailer.2.xml
+echo " <button>" >> /tmp/appletrailer.2.xml
+echo " <type>VIDEO_BROWSER</type>" >> /tmp/appletrailer.2.xml
+echo " <text>Play All Trailers</text>" >> /tmp/appletrailer.2.xml
+echo " <action>EXEC /usr/bin/play_trailer.sh /home/mythtv/all_trailers</action>" >> /tmp/appletrailer.2.xml
+echo " </button>" >> /tmp/appletrailer.2.xml
+echo "" >> /tmp/appletrailer.2.xml
+echo " <button>" >> /tmp/appletrailer.2.xml
+echo " <type>VIDEO_BROWSER</type>" >> /tmp/appletrailer.2.xml
+echo " <text>Shuffle Play Trailers</text>" >> /tmp/appletrailer.2.xml
+echo " <action>EXEC /usr/bin/play_trailer.sh /home/mythtv/shuffle_trailers</action>" >> /tmp/appletrailer.2.xml
+echo " </button>" >> /tmp/appletrailer.2.xml
+echo "" >> /tmp/appletrailer.2.xml
+echo " <button>" >> /tmp/appletrailer.2.xml
+echo " <type>VIDEO_BROWSER</type>" >> /tmp/appletrailer.2.xml
+echo " <text>Play Random Trailer</text>" >> /tmp/appletrailer.2.xml
+echo " <action>EXEC loading.sh &amp;&amp; mplayer -fs -zoom -really-quiet -user-agent "QuickTime/7.6.2" -cache 16000 \$(sort -R /home/mythtv/all_trailers | tail -1)</action>" >> /tmp/appletrailer.2.xml
+echo " </button>" >> /tmp/appletrailer.2.xml
+echo "" >> /tmp/appletrailer.2.xml
+
+grep -v TRAILERS /tmp/appletrailer.xml >> /tmp/appletrailer.2.xml
+mv /tmp/b.log /home/mythtv/all_trailers
+mv /tmp/c.log /home/mythtv/shuffle_trailers
+mv /tmp/appletrailer.2.xml /home/mythtv/appletrailer.xml