update: general cleanup

This commit is contained in:
HDVinnie
2020-12-03 00:16:23 -05:00
parent 8efb7b4c58
commit 601e4c1f90
17 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ class CasinoBot
*/
public function putDonate($amount = 0, $note = '')
{
$output = \implode(' ', $note);
$output = \implode($note, ' ');
$v = \validator(['bot_id' => $this->bot->id, 'amount'=> $amount, 'note'=> $output], [
'bot_id' => 'required|exists:bots,id|max:999',
'amount' => \sprintf('required|numeric|min:1|max:%s', $this->target->seedbonus),
+2 -2
View File
@@ -42,9 +42,9 @@ class IRCAnnounceBot
protected $socket = null;
private $channel = null;
private $channel;
private $username = null;
private $username;
private $registered = false;
+1 -1
View File
@@ -378,7 +378,7 @@ class NerdBot
*/
public function putDonate($amount = 0, $note = '')
{
$output = \implode(' ', $note);
$output = \implode($note, ' ');
$v = \validator(['bot_id' => $this->bot->id, 'amount'=> $amount, 'note'=> $output], [
'bot_id' => 'required|exists:bots,id|max:999',
'amount' => \sprintf('required|numeric|min:1|max:%s', $this->target->seedbonus),
+1 -1
View File
@@ -94,7 +94,7 @@ class SystemBot
*/
public function putGift($receiver = '', $amount = 0, $note = '')
{
$output = \implode(' ', $note);
$output = \implode($note, ' ');
$v = \validator(['receiver' => $receiver, 'amount'=> $amount, 'note'=> $output], [
'receiver' => 'required|string|exists:users,username',
'amount' => \sprintf('required|numeric|min:1|max:%s', $this->target->seedbonus),
-1
View File
@@ -15,7 +15,6 @@ namespace App\Console\Commands;
use App\Models\Graveyard;
use App\Models\History;
use App\Models\Message;
use App\Models\PrivateMessage;
use App\Models\Torrent;
use App\Models\User;
@@ -46,6 +46,7 @@ class EmailBlacklistUpdate extends Command
* Execute the console command.
*
* @return mixed
* @throws \JsonException
*/
public function handle()
{
-1
View File
@@ -13,7 +13,6 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
+2 -1
View File
@@ -315,7 +315,8 @@ class BonusController extends Controller
return false;
}
} elseif ($item['invite'] == true) {
if ($user_acc->invites += $item['value']) {
$user_acc->invites += $item['value'];
if ($user_acc->invites) {
$user_acc->save();
} else {
return false;
@@ -14,7 +14,6 @@
namespace App\Http\Controllers\MediaHub;
use App\Http\Controllers\Controller;
use App\Models\Movie;
class MovieController extends Controller
{
@@ -13,7 +13,6 @@
namespace App\Http\Controllers;
use App\Models\Notification;
use Carbon\Carbon;
use Illuminate\Http\Request;
@@ -146,7 +146,7 @@ class PollController extends Controller
}
// Update existing options
$existingOldOptionContents = \collect($storePoll->input('option-content'))->map(fn ($content) => \strval($content))->all();
$existingOldOptionContents = \collect($storePoll->input('option-content'))->map(fn ($content) => (string)$content)->all();
if (\count($existingOldOptionContents) === \count($existingOldOptionIds)) {
$len = \count($existingOldOptionContents);
@@ -39,7 +39,7 @@ class VersionController extends Controller
public function checkVersion()
{
$client = new Client();
$response = \json_decode($client->get('//api.github.com/repos/HDInnovations/UNIT3D/releases')->getBody(), true);
$response = \json_decode($client->get('//api.github.com/repos/HDInnovations/UNIT3D/releases')->getBody(), true, 512, JSON_THROW_ON_ERROR);
$lastestVersion = $response[0]->tag_name;
return \response([
+3 -1
View File
@@ -1393,7 +1393,9 @@ class UserController extends Controller
'user' => $user,
'active' => $table,
])->render();
} elseif ($request->has('view') && $request->input('view') == 'unsatisfieds') {
}
if ($request->has('view') && $request->input('view') == 'unsatisfieds') {
if (\config('hitrun.enabled') == true) {
$history = History::selectRaw('distinct(history.info_hash), max(torrents.id), max(history.completed_at) as completed_at, max(torrents.name) as name, max(history.created_at) as created_at, max(history.id) as id, max(history.user_id) as user_id, max(history.seedtime) as seedtime, max(history.seedtime) as satisfied_at, max(history.seeder) as seeder, max(torrents.size) as size,max(torrents.leechers) as leechers,max(torrents.seeders) as seeders,max(torrents.times_completed) as times_completed')->with(['torrent' => function ($query) {
$query->withAnyStatus();
+1
View File
@@ -67,6 +67,7 @@ class WishController extends Controller
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse
* @throws \JsonException
*/
public function store(Request $request)
{
-4
View File
@@ -18,10 +18,6 @@ use App\Helpers\HiddenCaptcha;
use App\Interfaces\ByteUnitsInterface;
use App\Interfaces\WishInterface;
use App\Models\Page;
use App\Models\Torrent;
use App\Models\User;
use App\Observers\TorrentObserver;
use App\Observers\UserObserver;
use App\Repositories\WishRepository;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
-1
View File
@@ -14,7 +14,6 @@
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
+6 -2
View File
@@ -67,11 +67,12 @@ trait Auditable
/**
* Generates the data to store.
*
* @param $action
* @param $action
* @param array $old
* @param array $new
*
* @return false|string
* @throws \JsonException
*/
protected static function generate($action, $old = [], $new = [])
{
@@ -79,7 +80,6 @@ trait Auditable
switch ($action) {
default:
throw new \InvalidArgumentException(\sprintf('Unknown action `%s`.', $action));
break;
case 'create':
// Expect new data to be filled
if (empty($new)) {
@@ -144,6 +144,8 @@ trait Auditable
* Logs a record creation.
*
* @param $model
*
* @throws \JsonException
*/
protected static function registerCreate($model)
{
@@ -172,6 +174,7 @@ trait Auditable
* Logs a record update.
*
* @param $model
* @throws \JsonException
*/
protected static function registerUpdate($model)
{
@@ -200,6 +203,7 @@ trait Auditable
* Logs a record deletion.
*
* @param $model
* @throws \JsonException
*/
protected static function registerDelete($model)
{