From 8f15262d018b9e85c3aba2080781b3ba0b46bda6 Mon Sep 17 00:00:00 2001 From: "4 raccoons in a trenchcoat. / luna vivian" Date: Thu, 20 Apr 2023 01:04:03 +0200 Subject: [PATCH] search page overhaul it now looks as good as the feed, the homepage and the favourites! :3 additionally, the search page now also mentions your search term, in case you suddenly decide to leave that tab alone for some reason and come back to it later, only to no longer know what you searched for lol --- templates/themes/default-v2/search.html | 23 +++++++++++++++-------- webroot/search.shs | 4 +++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/templates/themes/default-v2/search.html b/templates/themes/default-v2/search.html index 7b8248e..c52e0bd 100644 --- a/templates/themes/default-v2/search.html +++ b/templates/themes/default-v2/search.html @@ -1,8 +1,15 @@ -{{start _results}} - - -
{{.title}}
- | {{.runtime}} seconds | {{.views}} views
-Uploaded by {{.channel}}
- -{{end _results}} +{{start ?query}} +

Results for "{{.query}}"

+
+ {{start _results}} +
+ +
+ {{.title}}

+ Uploaded by {{.channel}} · {{.runtime}} · {{.views}} views +
+ {{end _results}} +
+{{else ?query}} +

search for something will 'ya?

+{{end ?query}} \ No newline at end of file diff --git a/webroot/search.shs b/webroot/search.shs index 174402e..4cea146 100755 --- a/webroot/search.shs +++ b/webroot/search.shs @@ -12,6 +12,8 @@ fi #https://www.youtube.com/results?search_query=oooo if [[ "${get_data[search_query]}" ]]; then query="${get_data[search_query]}" + meow[query]=$(sed -s 's/+/ /g' <<< "${get_data[search_query]}") + meow[?query]=true query_nice=$(sed -s 's/+/ /g' <<< "${get_data[search_query]}") fi @@ -34,7 +36,7 @@ if [[ "${get_data[search_query]}" ]]; then for (( i=0; i<${#id[@]}; i++ )); do strings[id]="${id[$i]}" strings[title]="${title[$i]}" - strings[runtime]="${runtime[$i]}" + strings[runtime]="$(date -d "@${runtime[$i]}" "+%H:%M:%S")" strings[views]="${views[$i]}" strings[channel_id]="${channel_id[$i]}" strings[channel]="${channel[$i]}"