diff --git a/templates/themes/default-v2/channel.html b/templates/themes/default-v2/channel.html
index 165e962..23ce287 100644
--- a/templates/themes/default-v2/channel.html
+++ b/templates/themes/default-v2/channel.html
@@ -1,4 +1,4 @@
-
Channel "{{.subscribe}}"
+{{start ?cnnc}}Channel "{{.subscribe}}"
{{end ?cnnc}}
{{.err}}
{{start ?sub}}Subscribe to {{.subscribe}}!
{{end ?sub}}
{{start ?unsub}}Unsubscribe from {{.subscribe}}!
{{end ?unsub}}
diff --git a/webroot/channel.shs b/webroot/channel.shs
index 6a3a992..7565c63 100644
--- a/webroot/channel.shs
+++ b/webroot/channel.shs
@@ -29,11 +29,26 @@ if [[ "${get_data[id]}" ]]; then
else
strings[?login]=true
#strings[login_r]=$(sed -s 's/?/___/' <<< "${r[url]}")
- strings[login_r]="channel.shs___id=${get_data[id]}"
+ strings[login_r]="channel/${get_data[id]}"
+ fi
+elif [[ "${params[id]}" ]]; then
+ if [[ "${cookies[sh_session]}" != '' ]]; then
+ if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "${strings[channel_id]}") == '' ]]; then
+ strings[?sub]=true
+ strings[channel_id]="${params[id]}"
+ else
+ strings[?unsub]=true
+ strings[channel_id]="${params[id]}"
+ fi
+ else
+ strings[?login]=true
+ #strings[login_r]=$(sed -s 's/?/___/' <<< "${r[url]}")
+ strings[login_r]="channel/${params[id]}"
fi
-else
- strings[?suberror]=true
fi
+#else
+ #strings[?suberror]=true
+#fi
title=$(jq -r '.title' <<< $data)
@@ -47,7 +62,10 @@ IFS=$'\n'
video_title=($(jq -r 'if .entries[].channel_follower_count != null then .entries[].entries[] else .entries[] end | .title' <<< $data))
video_id=($(jq -r 'if .entries[].channel_follower_count != null then .entries[].entries[] else .entries[] end | .id' <<< $data))
-strings[subscribe]="$(html_encode "$title" | sed -E "s/ - Videos//g")"
+if [[ $title != 'null' ]]; then
+ strings[?cnnc]=true
+ strings[subscribe]="$(html_encode "$title" | sed -E "s/ - Videos//g")"
+fi
nested_declare meow
declare -A nyaa
@@ -62,7 +80,7 @@ strings[_videos]+="meow"
nested_get meow 0
strings[err]=''
if [[ "${res[id]}" == '' ]]; then
- strings[err]="Failed to fetch videos... :c"
+ strings[err]="Failed to fetch videos."
fi
render strings "${cfg[namespace]}/templates/themes/${cfg[template]}/channel.html"