]> git.plutz.net Git - serve0/blobdiff - actions/watch.sh
send reference to return page for various actions
[serve0] / actions / watch.sh
index b7fad863753d47f28bc40b94c5c9cd81e1a80d4d..546654c6adfcdd2b7583d615e46d2b31dab94991 100755 (executable)
@@ -9,13 +9,9 @@ search="${_POST[s]}"
 filter="${_POST[f]}"
 page="${_POST[pn]}"
 
-watch_link=''
+watch_link="${_POST[page]}&"
 [ -n "$location" ] && watch_link="l=$(urlsafe "${location}")&"
 [ -n "$info" ]     && watch_link="i=$(urlsafe "${info}")&"
-[ -n "$order" ]    && watch_link="${watch_link}o=${order}&"
-[ -n "$search" ]   && watch_link="${watch_link}s=${search}&"
-[ -n "$filter" ]   && watch_link="${watch_link}f=${filter}&"
-[ -n "$page" ]     && watch_link="${watch_link}pn=${page}"
 
 meta="${_DATA}/meta/$info.meta"
 head -n1 "$meta" |read length width height filename
@@ -31,6 +27,7 @@ if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then
 elif [ -n "$foreign" ]; then
   _COOKIE[watch]=server
   videourl="${_GET[url]}"
+  watch_link="${_POST[return]}"
 elif [ -z "$info" ]; then
   videourl="$(urlsafe "${location#/}")"
 else
@@ -39,8 +36,8 @@ fi
 
 case "$_COOKIE[watch]" in
   raspi)
-    rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&url="
-    redirect "${rpiaddr}$(urlsafe "http://${HTTP_HOST}/${videourl}")"
+    rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch"
+    redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/?${_POST[page]}")"
   ;;
   480p)
     [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \