diff --git a/include/functions.php b/include/functions.php index f0d2e8fd..5a6fc486 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,4 +1,5 @@ whereIn('torrent_id', $torrentIdArr)->orderByRaw("field(tag_id,$tagIdStr)")->get(); $tagKeyById = $tagCollection->keyBy('id'); $torrentTagResult = $torrentTagCollection->groupBy('torrent_id'); + $approvalStatusIconEnabled = \App\Models\Setting::get('torrent.approval_status_icon_enabled') == 'yes'; $last_browse = $CURUSER['last_browse']; // if ($variant == "torrent"){ @@ -3449,7 +3451,10 @@ foreach ($rows as $row) $banned_torrent = ($row["banned"] == 'yes' ? " (".$lang_functions['text_banned'].")" : ""); $sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false); - $approvalStatusIcon = $torrent->renderApprovalStatus($row['approval_status']); + $approvalStatusIcon = ''; + if ($approvalStatusIconEnabled) { + $approvalStatusIcon = $torrent->renderApprovalStatus($row['approval_status']); + } $titleSuffix = $banned_torrent.$picked_torrent.$sp_torrent.$sp_torrent_sub. $hrImg . $approvalStatusIcon; $titleSuffix = apply_filter('torrent_title_suffix', $titleSuffix, $row); print($titleSuffix); diff --git a/nexus/Torrent/Torrent.php b/nexus/Torrent/Torrent.php index 7e6e819e..7a02b6d5 100644 --- a/nexus/Torrent/Torrent.php +++ b/nexus/Torrent/Torrent.php @@ -88,10 +88,7 @@ class Torrent public function renderApprovalStatus($status): string { - if (Setting::get('torrent.approval_status_icon_enabled') == 'yes') { - return sprintf('%s', \App\Models\Torrent::$approvalStatus[$status]['icon']); - } - return ''; + return sprintf('%s', \App\Models\Torrent::$approvalStatus[$status]['icon']); } }