From 3990c740385b9fe037e9faf95a5a82b360f34f73 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Wed, 4 May 2022 15:20:15 +0800 Subject: [PATCH] hot&classic do not resize cover --- app/Console/Commands/Test.php | 5 ++++- app/Models/User.php | 42 +---------------------------------- include/constants.php | 2 +- include/functions.php | 4 ++-- 4 files changed, 8 insertions(+), 45 deletions(-) diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 0a3e57c3..7ec6d3f9 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -126,7 +126,10 @@ class Test extends Command // $r = $rep->getContinuousDays($attendance); // $r = $rep->getContinuousPoints(11); - $r = parse_url('https://img9.doubanio.com/view/photo/l_ratio_poster/public/p2867903173.jpg', PHP_URL_SCHEME); + $database = nexus_env('GEOIP2_DATABASE'); + $reader = new \GeoIp2\Database\Reader($database); + $city = $reader->city("95.211.156.168"); + $r = $city->country; dd($r); } diff --git a/app/Models/User.php b/app/Models/User.php index 3dbc54ed..287fb6bc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -69,7 +69,7 @@ class User extends Authenticatable self::DONATE_NO => ['text' => 'No'], ]; - public static $cardTitles = [ + public static array $cardTitles = [ 'uploaded_human' => '上传量', 'downloaded_human' => '下载量', 'share_ratio' => '分享率', @@ -79,32 +79,6 @@ class User extends Authenticatable 'invites' => '邀请', ]; - public function mappableAs(): array - { - return [ - 'id' => 'long', - 'username' => [ - 'type' => 'text', - 'analyzer' => 'ik_max_word', - ], - 'email' => [ - 'type' => 'text', - 'analyzer' => 'ik_max_word', - ], - 'added' => 'date', - ]; - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'username' => $this->username, - 'email' => $this->email, - 'added' => $this->added, - ]; - } - public function getClassTextAttribute(): string { if (!isset(self::$classes[$this->class]['text'])) { @@ -118,20 +92,6 @@ class User extends Authenticatable return $classText; } - public function getDonateStatusAttribute() - { - if (empty($this->donoruntil) || $this->donoruntil == '0000-00-00 00:00:00') { - return self::DONATE_NO; - } - return self::DONATE_YES; - } - - public function getSeedPointsAttribute(): string - { - return $this->seed_points ?? 0; - } - - /** * 为数组 / JSON 序列化准备日期。 * diff --git a/include/constants.php b/include/constants.php index de73ccf5..d057b281 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ "; + $thumbnail = "\"poster\""; } elseif ($imdb_id = parse_imdb_id($array["url"])) { if (array_search($imdb_id, $allImdb) !== false) { //a torrent with the same IMDb url already exists continue; @@ -5082,7 +5082,7 @@ function displayHotAndClassic() if (empty($photo_url)) { do_log("torrent: {$array['id']}, url: {$array['url']}, imdb_id: $imdb_id can not get photo", 'error'); } - $thumbnail = "\"poster\""; + $thumbnail = "\"poster\""; } catch (\Exception $exception) { do_log($exception->getMessage() . "\n[stacktrace]\n" . $exception->getTraceAsString(), 'error'); continue;