From 96458c41a80f9dcada46cb9cec2fed803f1a6484 Mon Sep 17 00:00:00 2001 From: "4 raccoons in a trenchcoat. / luna vivian" Date: Thu, 20 Apr 2023 00:18:51 +0200 Subject: [PATCH] hide "likes" word when video likes are turned off As the title already says, this hides the "likes" word right next to where the like counter is supposed to be, when the video creator turned the like counter off for the video. --- templates/themes/default-v2/watch.html | 2 +- webroot/watch.shs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/themes/default-v2/watch.html b/templates/themes/default-v2/watch.html index afc0a63..c4db12b 100644 --- a/templates/themes/default-v2/watch.html +++ b/templates/themes/default-v2/watch.html @@ -19,7 +19,7 @@ {{.view_count}} views
- {{.like_count}} likes
+ {{.like_count}}{{start ?like_state}} likes{{end ?like_state}}
diff --git a/webroot/watch.shs b/webroot/watch.shs index 0a1eb91..e2feda5 100755 --- a/webroot/watch.shs +++ b/webroot/watch.shs @@ -134,9 +134,10 @@ if [[ "${get_data[v]}" ]]; then strings[view_count]=$(jq -r '.view_count' <<< "$video" | format_numbers) like_count=$(jq -r '.like_count' <<< "$video" | format_numbers) if [[ $like_count == 'null' ]]; then - strings[like_count]="Likes are turned off" + strings[like_count]="Likes are turned off..." else strings[like_count]="$like_count" + strings[?like_state]=true fi strings[sub]='' strings[id]="${get_data[v]}"