info="$_GET[\"i\"]"
filter="$_GET[\"f\"]"
search="$_GET[\"s\"]"
-order=$(echo "$_GET[\"o\"]" |egrep '^(Name|Date|Length)$')
-page=$(echo "$_GET[\"p\"]" |egrep '^[0-9]+$')
+order=$(echo -E "$_GET[\"o\"]" |egrep '^(Name|Date|Length)$')
+page=$(echo -E "$_GET[\"p\"]" |egrep '^[0-9]+$')
[ -z "$page" ] && page=0
page_link=''
-[ -n "$info" ] && page_link="i=$(echo -n "$info" |sed -r 's:%:%25:g;s:\&:%26:g;')&"
+[ -n "$info" ] && page_link="i=$(echo -En "$info" |sed -r 's:%:%25:g;s:\&:%26:g;')&"
[ -n "$order" ] && page_link="${page_link}o=${order}&"
[ -n "$search" ] && page_link="${page_link}s=${search}&"
[ -n "$filter" ] && page_link="${page_link}f=${filter}&"
fi
}
-alias urlsave="sed 's:%:\%25:g;s:\?:\%3F:g;s:&:\%26:g;s:'\'':\%27:g;s: :\%20:g;s;!;\%21;g;s;\(;\%28;g;s;\);\%29;g;'"
-
_printVideo(){
info="$1"
cache="${_DATA}/cache/$info.cache"
[ -r "$meta" ] || ". ${_EXEC}/helpers/genmeta.sh" "$video" "$meta"
[ -r "$thumb" ] || ". ${_EXEC}/helpers/genthumb.sh" "$video" "$thumb"
[ -L "$mpfake" ] || ln -s "../videos/$info" "$mpfake"
- video="$(echo "videos/$info" |urlsave)"
- thumb="$(echo "thumbs/$info.jpg" |urlsave)"
- mpfake="$(echo "$info" |sed -r 's:^(.*)\.[a-zA-Z0-9]{3,4}$:mp4/\1.mp4:' |urlsave)"
+ video="$(urlsave "videos/$info")"
+ thumb="$(urlsave "thumbs/$info.jpg")"
+ mpfake="$(urlsave "$info" |sed -r 's:^(.*)\.[a-zA-Z0-9]{3,4}$:mp4/\1.mp4:')"
[ "$(($length % 60))" -lt 10 ] &&\
minutes="$(($length / 60)):0$(($length % 60))" ||\
minutes="$(($length / 60)):$(($length % 60))"
- linkinfo="$(echo -n "$info" |urlsave)"
+ linkinfo="$(urlsave "$info")"
tee "$cache" <<VIDEOend
<li class="thumb">
<a class="watchlink" name="$linkinfo" href="?action=watch&i=$linkinfo">
<input type="checkbox" name="tagsel" value="$info">
<span class="info property">${minutes}min</span>
<span class="info property">${width}x${height}</span>
- $(echo "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span>:g')
+ $(echo -E "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span>:g')
</div>
VIDEOend
fi
$genlist |sed -rn 's:^(.+)$:'"${_DATA}"'/meta/\1'.meta':p' |xargs -d\\n egrep -sil "$search" |sed -rn 's:^(.*/)+([^/]+)\.meta$:\2:p'
elif [ "$filterex" != "q0" ]; then
$genlist |while read video; do
- [ -r "${_DATA}/meta/$video.meta" ] && sed -rn "2{$filterex;q1}" "${_DATA}/meta/$video.meta" && echo "$video"
+ [ -r "${_DATA}/meta/$video.meta" ] && sed -rn "2{$filterex;q1}" "${_DATA}/meta/$video.meta" && echo -E "$video"
done
else
$genlist