improved rclid3 and rclogg
This commit is contained in:
+19
-15
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# @(#$Id: rclogg,v 1.1 2007-10-02 14:00:47 dockes Exp $ (C) 2007 J.F.Dockes
|
||||
# @(#$Id: rclogg,v 1.2 2008-10-08 08:27:34 dockes Exp $ (C) 2007 J.F.Dockes
|
||||
#================================================================
|
||||
# rclogg
|
||||
# Handle ogg audio files for recoll.
|
||||
@@ -74,33 +74,37 @@ fi
|
||||
# !! Leave the following line unmodified !
|
||||
#ENDRECFILTCOMMONCODE
|
||||
|
||||
checkcmds ogginfo
|
||||
checkcmds ogginfo sed awk
|
||||
|
||||
# output the result
|
||||
echo '<html><head>'
|
||||
#echo '<title>' "$title" '</title>'
|
||||
echo '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'
|
||||
echo '</head><body>'
|
||||
echo '<pre>'
|
||||
|
||||
nocaptionexp='/=/s/.*=//p'
|
||||
kpcaptionexp='/=/p'
|
||||
if test X$RECOLL_FILTER_FORPREVIEW = Xyes
|
||||
then
|
||||
|
||||
echo '</head><body><pre>'
|
||||
ogginfo "$infile" | grep '=' | sed -e 's/&/&/g' -e 's/"/"/g' \
|
||||
-e 's/</</g' -e 's/>/>/g'
|
||||
echo '</pre></body></html>'
|
||||
|
||||
if test X$RECOLL_FILTER_FORPREVIEW = Xyes ; then
|
||||
captionexp=$kpcaptionexp
|
||||
else
|
||||
captionexp=$nocaptionexp
|
||||
ogginfo "$infile" | grep '=' | awk -F= \
|
||||
'{sub("^[ ]+", "", $1)
|
||||
sub("&", "&", $2)
|
||||
sub("\"", """, $2)
|
||||
sub("<", "<", $2)
|
||||
sub(">", ">", $2)
|
||||
printf "<meta name=\"%s\" content=\"%s\">\n", $1, $2
|
||||
body=body $2 "\n"
|
||||
}
|
||||
END{print "</head><body><pre>";print body;print "</pre></body></html>"}'
|
||||
fi
|
||||
|
||||
# Note: ogginfo output is unparseable: the COMMENT field can be
|
||||
# multiline, but there is no way to detect the end of the 'User
|
||||
# comments' area
|
||||
ogginfo "$infile" | \
|
||||
sed -n \
|
||||
-e "$captionexp"
|
||||
|
||||
echo '</pre>'
|
||||
echo '</body></html>'
|
||||
|
||||
# exit normally
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user