summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-scripts/screenshooter.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/linhes-scripts/screenshooter.sh')
-rw-r--r--[-rwxr-xr-x]abs/core/linhes-scripts/screenshooter.sh20
1 files changed, 7 insertions, 13 deletions
diff --git a/abs/core/linhes-scripts/screenshooter.sh b/abs/core/linhes-scripts/screenshooter.sh
index 3bacac1..72f6cc0 100755..100644
--- a/abs/core/linhes-scripts/screenshooter.sh
+++ b/abs/core/linhes-scripts/screenshooter.sh
@@ -87,16 +87,11 @@ if [ ! -d "$VIDEO_CAPTURE_HOME" ] ; then
fi
VIDEO_HOME=$(mysql -u $DBUSERNAME --password=$DBPASSWORD -h $BACKEND_HOSTNAME mythconverg -sNBe "select data from settings where value='VideoStartupDir' limit 1")
-VIDEO_HOME=(${VIDEO_HOME//:/ });
-VIDEO_HOME_COUNT=${#VIDEO_HOME[@]}
-for (( i=0; i<${VIDEO_HOME_COUNT}; i++ ));
-do
- if [ ! -d "${VIDEO_HOME[${i}]}" ] ; then
- echo "Directory ${VIDEO_HOME[${i}]} does not exist, nowhere to put the screen shot!"
- echo "Have you configured MythVideo yet?"
- exit 1
- fi
-done
+if [ ! -d "$VIDEO_HOME" ] ; then
+ echo "Directory $VIDEO_HOME does not exist, nowhere to put the screen shot!"
+ echo "Have you configured MythVideo yet?"
+ exit 1
+fi
VIDEO_FILENAME=$(basename "$VIDEO_PATHNAME")
VIDEO_EXTENSION=${VIDEO_FILENAME##*.}
@@ -135,7 +130,7 @@ if [ "$EXTENSION_CHECK" == "1" ]; then
# if [ "$VERBOSE" == "1" ]; then
# echo "Importing $VIDEO_FILENAME in to database."
# fi
- # mysql -u $DBUSERNAME --password=$DBPASSWORD -h $BACKEND_HOSTNAME mythconverg -sNBe "insert into videometadata (intid, title, director, plot, rating, inetref, year, userrating, length, showlevel, filename, coverfile, childid, browse, playcommand, category) values (' ', '$VIDEO_FILENAME', 'Unknown', 'Unknown', 'NR', '00000000', 1895, 0.0, 0, 1, '$VIDEO_PATHNAME', '', -1, 1, ' ', 0);"
+ # mysql -u $DBUSERNAME --password=$DBPASSWORD -h $BACKEND_HOSTNAME mythconverg -sNBe "insert into videometadata (intid, title, director, plot, rating, inetref, year, userrating, length, showlevel, filename, coverfile, childid, browse, playcommand, category) values (' ', '$VIDEO_FILENAME', 'Unknown', 'Unknown', 'NR', '00000000', 1895, 0.0, 0, 1, '$VIDEO_PATHNAME', 'No Cover', -1, 1, ' ', 0);"
fi
fi
fi
@@ -145,7 +140,7 @@ if [ "$CLOBBER" -eq 0 ]; then
SQL_CMD="select coverfile from videometadata where filename=\"$VIDEO_PATHNAME\";"
CURRENT_COVERFILE=`mysql -u $DBUSERNAME --password=$DBPASSWORD -h $BACKEND_HOSTNAME mythconverg -B -e "$SQL_CMD" | tail -1`
- if [[ "$CURRENT_COVERFILE" != "" ]] && [[ "$CURRENT_COVERFILE" != "" ]]; then
+ if [[ "$CURRENT_COVERFILE" != "" ]] && [[ "$CURRENT_COVERFILE" != "No Cover" ]]; then
# there's already a cover file for this video
if [ "$VERBOSE" == "1" ]; then
echo "$VIDEO_FILENAME has cover file, skipping."
@@ -161,7 +156,6 @@ VIDEO_CAPTURE_PATHNAME="$VIDEO_CAPTURE_HOME/$VIDEO_FILENAME.png"
# How many frames of video to capture. We'll grab the last frame as our screenshot.
if [ "$VIDEO_EXTENSION" == "m4v" ]; then
FRAMES_TO_CAPTURE="90"
- SHOTFILE="000000"$FRAMES_TO_CAPTURE".png"
else
FRAMES_TO_CAPTURE="05"
fi