mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-05 07:20:58 +08:00
show seed box icon configurable
This commit is contained in:
@@ -17,9 +17,11 @@ class SearchBox extends NexusModel
|
||||
];
|
||||
|
||||
const EXTRA_DISPLAY_COVER_ON_TORRENT_LIST = 'display_cover_on_torrent_list';
|
||||
const EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST = 'display_seed_box_icon_on_torrent_list';
|
||||
|
||||
public static array $extras = [
|
||||
self::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => ['text' => 'Display cover on torrent list'],
|
||||
self::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => ['text' => 'Display seed box icon on torrent list'],
|
||||
];
|
||||
|
||||
public static function listExtraText(): array
|
||||
|
||||
@@ -3320,14 +3320,17 @@ function torrenttable($rows, $variant = "torrent", $searchBoxId = 0) {
|
||||
$tagKeyById = $tagCollection->keyBy('id');
|
||||
$torrentTagResult = $torrentTagCollection->groupBy('torrent_id');
|
||||
$showCover = false;
|
||||
$showSeedBoxIcon = get_setting('seed_box.enabled') == 'yes';
|
||||
if ($searchBoxId) {
|
||||
$searchBoxExtra = get_searchbox_value($searchBoxId, "extra");
|
||||
if (!empty($searchBoxExtra[\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST])) {
|
||||
$showCover = true;
|
||||
}
|
||||
if (empty($searchBoxExtra[\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST])) {
|
||||
$showSeedBoxIcon = false;
|
||||
}
|
||||
}
|
||||
//seedBoxIcon
|
||||
$showSeedBoxIcon = get_setting('seed_box.enabled') == 'yes';
|
||||
if ($showSeedBoxIcon) {
|
||||
$seedBoxRep = new \App\Repositories\SeedBoxRepository();
|
||||
$ownerPeerInfo = \App\Models\Peer::query()
|
||||
|
||||
@@ -250,6 +250,7 @@ class Update extends Install
|
||||
$this->runMigrate('database/migrations/2022_09_02_031539_add_extra_to_searchbox_table.php');
|
||||
SearchBox::query()->update(['extra' => [
|
||||
SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => 1,
|
||||
SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => 1,
|
||||
]]);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,5 +11,6 @@ return [
|
||||
'sub_category_audio_codec_label' => 'AudioCodec',
|
||||
'extras' => [
|
||||
\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => 'Display cover on torrent list',
|
||||
\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => 'Display seed box icon on torrent list',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -11,5 +11,6 @@ return [
|
||||
'sub_category_audio_codec_label' => '音频编码',
|
||||
'extras' => [
|
||||
\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => '种子列表页展示封面',
|
||||
\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => '种子列表页展示 SeedBox 图标',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -11,5 +11,6 @@ return [
|
||||
'sub_category_audio_codec_label' => '音頻編碼',
|
||||
'extras' => [
|
||||
\App\Models\SearchBox::EXTRA_DISPLAY_COVER_ON_TORRENT_LIST => '種子列表頁展示封面',
|
||||
\App\Models\SearchBox::EXTRA_DISPLAY_SEED_BOX_ICON_ON_TORRENT_LIST => '種子列表頁展示 SeedBox 圖標',
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user