From 0e7b5adf76bc7536804b1b19b0a21617a927ddd5 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 6 Sep 2022 20:56:08 +0800 Subject: [PATCH 1/3] improve userdetails page claim btn display --- include/constants.php | 2 +- public/getusertorrentlistajax.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/constants.php b/include/constants.php index e1d5ff46..07693973 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ "."". str_replace(" ", "
", gettime($arr['completedat'],false)). ""; if ($showanonymous) $ret .= "".$arr['anonymous'].""; - if ($showActionClaim) { + $claimButton = ''; + if ($showActionClaim && \App\Models\Claim::getConfigIsEnabled() && \Carbon\Carbon::parse($arr['added'])->addDays($claimTorrentTTL)->lte(\Carbon\Carbon::now())) { $claim = $claimData->get($arr['torrent']); $claimButton = $claimRep->buildActionButtons($arr['torrent'], $claim); - $ret .= sprintf('%s', $claimButton); } + $ret .= sprintf('%s', $claimButton); $ret .="\n"; } From 8eda506f6c5a83a65cd16161ea9b35eb478e7836 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 6 Sep 2022 21:37:47 +0800 Subject: [PATCH 2/3] fix upload name auto fill --- app/Repositories/TorrentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/TorrentRepository.php b/app/Repositories/TorrentRepository.php index 12b9676c..aab17db3 100644 --- a/app/Repositories/TorrentRepository.php +++ b/app/Repositories/TorrentRepository.php @@ -617,7 +617,7 @@ class TorrentRepository extends BaseRepository $input = <<
- + $note
$btn From 9231da1c6b0022d83e6177bed534051ad4573a39 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 6 Sep 2022 21:54:13 +0800 Subject: [PATCH 3/3] show seed box icon configurable --- app/Models/SearchBox.php | 2 ++ include/functions.php | 5 ++++- nexus/Install/Update.php | 1 + resources/lang/en/searchbox.php | 1 + resources/lang/zh_CN/searchbox.php | 1 + resources/lang/zh_TW/searchbox.php | 1 + 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Models/SearchBox.php b/app/Models/SearchBox.php index 2fab2971..57aa575e 100644 --- a/app/Models/SearchBox.php +++ b/app/Models/SearchBox.php @@ -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 diff --git a/include/functions.php b/include/functions.php index 7d752535..0ec9fffe 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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() diff --git a/nexus/Install/Update.php b/nexus/Install/Update.php index 0f454cc7..5dc5d344 100644 --- a/nexus/Install/Update.php +++ b/nexus/Install/Update.php @@ -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, ]]); } diff --git a/resources/lang/en/searchbox.php b/resources/lang/en/searchbox.php index e9c077e6..ceb08948 100644 --- a/resources/lang/en/searchbox.php +++ b/resources/lang/en/searchbox.php @@ -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', ], ]; diff --git a/resources/lang/zh_CN/searchbox.php b/resources/lang/zh_CN/searchbox.php index 114ce9cf..69344bbe 100644 --- a/resources/lang/zh_CN/searchbox.php +++ b/resources/lang/zh_CN/searchbox.php @@ -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 图标', ], ]; diff --git a/resources/lang/zh_TW/searchbox.php b/resources/lang/zh_TW/searchbox.php index 9c062526..e053f2b7 100644 --- a/resources/lang/zh_TW/searchbox.php +++ b/resources/lang/zh_TW/searchbox.php @@ -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 圖標', ], ];