]> git.plutz.net Git - serve0/blobdiff - constants.sh
cleaner filter builder
[serve0] / constants.sh
index 84d7c7a152ddf0f08336bbeba88bcca529c1ad03..266f73430d6d636fc706368aeafd3dbd878e649f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-# Copyright 2014 Paul Hänsch
+# Copyright 2014,2015 Paul Hänsch
 #
 # This file is part of Serve0.
 # 
 # You should have received a copy of the GNU Affero General Public License
 # along with Serve0.  If not, see <http://www.gnu.org/licenses/>. 
 
-_GET['page']=videoview
+alias _wiki="stx2any --no-template --link-abbrevs --quote -T html"
+[ -z "${_GET[p]}" ] && _GET[p]=list
+file_pattern='^.*(mov|ts|mpg|mpeg|mp4|m4v|avi|mkv|flv|sfv|wmv|ogm|webm|iso|rmvb)$'
+
+data_dirs cache meta mp4 videos thumbs trash by_length transcoded
+
+cgi_cookie
+validate(){ printf '%s\n' "$1" |sed -rn '2q;/^('"$2"')$/{p;q};a'"$3"; }
+
+_GET[o]=$( validate "${_GET[o]}"  'Name|Date|Length' Name)
+_GET[pn]=$(validate "${_GET[pn]}" '[1-9][0-9]*' 1)
+
+_COOKIE[pagesize]=$(validate "${_COOKIE[pagesize]}" '[1-9][0-9]*' 50)
+
+