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
This commit is contained in:
4 raccoons in a trenchcoat. / luna vivian 2023-04-23 22:48:28 +02:00 committed by Dominique Liberda
parent 21845a0823
commit dc670adb45

View file

@ -19,7 +19,7 @@ fi
if [[ "${get_data[id]}" ]]; then if [[ "${get_data[id]}" ]]; then
if [[ "${cookies[sh_session]}" != '' ]]; 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[?sub]=true
strings[channel_id]="${get_data[id]}" strings[channel_id]="${get_data[id]}"
else else
@ -33,7 +33,7 @@ if [[ "${get_data[id]}" ]]; then
fi fi
elif [[ "${params[id]}" ]]; then elif [[ "${params[id]}" ]]; then
if [[ "${cookies[sh_session]}" != '' ]]; 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[?sub]=true
strings[channel_id]="${params[id]}" strings[channel_id]="${params[id]}"
else else
@ -64,7 +64,7 @@ video_id=($(jq -r '.entries[].id' <<< $data))
if [[ $title != 'null' ]]; then if [[ $title != 'null' ]]; then
strings[?cnnc]=true 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 fi
nested_declare meow nested_declare meow