fix some stuff regarding the /channel page :3

+ fixed issue where it would say "Unsubscribe from {CHANNEL}!" even tho you aren't subscribed to it (fixes #20)
+ fixed issue where the channel name would contain "Uploads from" as a prefix to the actual channel's name
master
4 raccoons in a trenchcoat. / luna vivian 2023-04-23 22:48:28 +02:00 committed by Dominique Liberda
parent 21845a0823
commit dc670adb45
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ fi
if [[ "${get_data[id]}" ]]; then
if [[ "${cookies[sh_session]}" != '' ]]; then
if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "${strings[channel_id]}") == '' ]]; then
if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "${get_data[id]}") == '' ]]; then
strings[?sub]=true
strings[channel_id]="${get_data[id]}"
else
@ -33,7 +33,7 @@ if [[ "${get_data[id]}" ]]; then
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
if [[ $(grep $(session_get_username "${cookies[sh_session]}") storage/subscribed | grep "${params[id]}") == '' ]]; then
strings[?sub]=true
strings[channel_id]="${params[id]}"
else
@ -64,7 +64,7 @@ video_id=($(jq -r '.entries[].id' <<< $data))
if [[ $title != 'null' ]]; then
strings[?cnnc]=true
strings[subscribe]="$(html_encode "$title" | sed -E "s/ - Videos//g")"
strings[subscribe]="$(html_encode "$title" | sed -E "s/ - Videos//g" | sed -E "s/Uploads from //g")"
fi
nested_declare meow