add: upload snatches statistic

This commit is contained in:
Roardom
2023-06-17 09:22:47 +00:00
parent a4b34f4798
commit 4bba4e37c7
3 changed files with 12 additions and 1 deletions
+8
View File
@@ -561,6 +561,14 @@ class User extends Authenticatable
return $this->hasMany(FailedLoginAttempt::class);
}
/**
* Has many upload snatches.
*/
public function uploadSnatches(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
{
return $this->hasManyThrough(History::class, Torrent::class)->whereNotNull('completed_at');
}
/**
* Get the Users accepts notification as bool.
*/
+1
View File
@@ -372,6 +372,7 @@ return [
'unsatisfieds' => 'Unsatisfieds',
'upload-bon' => 'Upload Added from BON Store',
'upload-recorded' => 'Recorded Upload',
'upload-snatches' => 'Upload Snatches',
'upload-true' => 'True Upload',
'uploads' => 'Uploads',
'uploads-table' => 'Uploads Table',
+3 -1
View File
@@ -692,7 +692,9 @@
<dt>{{ __('user.thanks-received') }}</dt>
<dd>{{ $user->thanksReceived()->count() }}</dd>
<dt>{{ __('user.thanks-given') }}</dt>
<dd> {{ $user->thanksGiven()->count() }}</dd>
<dd>{{ $user->thanksGiven()->count() }}</dd>
<dt>{{ __('user.upload-snatches') }}</dt>
<dd>{{ $user->uploadSnatches()->count() }}</dd>
</dl>
</section>
@endif