fix torrentrss + backend torrent search

This commit is contained in:
xiaomlove
2023-09-23 03:04:58 +08:00
parent ea85572077
commit a84a6fd5c8
3 changed files with 12 additions and 6 deletions

View File

@@ -79,7 +79,9 @@ class TorrentResource extends Resource
Tables\Columns\TextColumn::make('basic_category.name')->label(__('label.torrent.category')),
Tables\Columns\TextColumn::make('name')->formatStateUsing(fn ($record) => torrent_name_for_admin($record, true))
->label(__('label.name'))
->searchable(),
->searchable(query: function (Builder $query, string $search) {
return $query->where("name", "like", "%{$search}%")->orWhere("small_descr", "like", "%{$search}%");
}),
Tables\Columns\TextColumn::make('posStateText')->label(__('label.torrent.pos_state')),
Tables\Columns\TextColumn::make('spStateText')->label(__('label.torrent.sp_state')),
Tables\Columns\TextColumn::make('pickInfoText')

View File

@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.7');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-09-22');
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.8');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-09-23');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -231,9 +231,13 @@ foreach ($list as $row)
{
$ownerInfo = get_user_row($row['owner']);
$title = "";
if ($row['anonymous'] == 'yes')
$author = 'anonymous';
else $author = $ownerInfo['username'];
if ($row['anonymous'] == 'yes') {
$author = 'anonymous';
} elseif (!empty($ownerInfo)) {
$author = $ownerInfo['username'];
} else {
$author = nexus_trans("nexus.user_not_exists");
}
$itemurl = $url."/details.php?id=".$row['id'];
if ($dllink)
$itemdlurl = $url."/download.php?id=".$row['id']."&amp;downhash=" . rawurlencode( $user['id'] . '|'. $torrentRep->encryptDownHash($row['id'], $user));