mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 21:01:22 +00:00
Latest pint fixes
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Elasticsearch\ClientBuilder;
|
||||
use Illuminate\Console\Command;
|
||||
use Manticoresearch\Client;
|
||||
use Manticoresearch\Exceptions\ResponseException;
|
||||
@@ -267,7 +268,7 @@ class CreateMediaIndexes extends Command
|
||||
try {
|
||||
// Create Elasticsearch client directly
|
||||
$esConfig = config('search.drivers.elasticsearch');
|
||||
$esClient = \Elasticsearch\ClientBuilder::create()
|
||||
$esClient = ClientBuilder::create()
|
||||
->setHosts($esConfig['hosts'] ?? [['host' => 'localhost', 'port' => 9200]])
|
||||
->build();
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Facades\Elasticsearch;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class NntmuxCheckIndex extends Command
|
||||
@@ -119,7 +121,7 @@ class NntmuxCheckIndex extends Command
|
||||
$baseUrl = "http://{$host}:{$port}";
|
||||
|
||||
// Check if table exists using HTTP API
|
||||
$client = new \GuzzleHttp\Client([
|
||||
$client = new Client([
|
||||
'base_uri' => $baseUrl,
|
||||
'timeout' => 10,
|
||||
'http_errors' => false, // Don't throw on HTTP errors
|
||||
@@ -227,13 +229,13 @@ class NntmuxCheckIndex extends Command
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
// Ignore describe errors
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->error("Error checking ManticoreSearch table: {$e->getMessage()}");
|
||||
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
|
||||
if ($e instanceof RequestException && $e->hasResponse()) {
|
||||
$this->error('Response body: '.$e->getResponse()->getBody());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Settings;
|
||||
use App\Services\Tmux\TmuxPaneManager;
|
||||
use App\Services\Tmux\TmuxSessionManager;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
@@ -47,7 +48,7 @@ class TmuxAttach extends Command
|
||||
$this->info('💡 Press Ctrl+A then D to detach');
|
||||
|
||||
// Select monitor pane before attaching so user lands there
|
||||
$paneManager = new \App\Services\Tmux\TmuxPaneManager($sessionName);
|
||||
$paneManager = new TmuxPaneManager($sessionName);
|
||||
$paneManager->selectWindow(0);
|
||||
$paneManager->selectPane('0.0');
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@ namespace App\Console\Commands;
|
||||
use App\Models\Collection;
|
||||
use App\Models\Settings;
|
||||
use App\Services\Tmux\TmuxLayoutBuilder;
|
||||
use App\Services\Tmux\TmuxPaneManager;
|
||||
use App\Services\Tmux\TmuxSessionManager;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
|
||||
class TmuxStart extends Command
|
||||
{
|
||||
@@ -100,7 +102,7 @@ class TmuxStart extends Command
|
||||
$this->startMonitor($sessionName);
|
||||
|
||||
// Select monitor pane (0.0) so attach lands there
|
||||
$paneManager = new \App\Services\Tmux\TmuxPaneManager($sessionName);
|
||||
$paneManager = new TmuxPaneManager($sessionName);
|
||||
$paneManager->selectWindow(0);
|
||||
$paneManager->selectPane('0.0');
|
||||
|
||||
@@ -133,7 +135,7 @@ class TmuxStart extends Command
|
||||
*/
|
||||
private function checkTmuxInstalled(): bool
|
||||
{
|
||||
$result = \Illuminate\Support\Facades\Process::timeout(5)
|
||||
$result = Process::timeout(5)
|
||||
->run('which tmux 2>/dev/null');
|
||||
|
||||
return $result->successful() && str_contains($result->output(), 'tmux');
|
||||
@@ -169,7 +171,7 @@ class TmuxStart extends Command
|
||||
*/
|
||||
private function startMonitor(string $sessionName): void
|
||||
{
|
||||
$paneManager = new \App\Services\Tmux\TmuxPaneManager($sessionName);
|
||||
$paneManager = new TmuxPaneManager($sessionName);
|
||||
|
||||
// Priority: new monitor > old monitor > artisan command
|
||||
$newMonitor = base_path('app/Services/Tmux/Scripts/monitor.php');
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -13,7 +14,7 @@ class UserAccessedApi
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
* @var User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -12,14 +13,14 @@ class UserLoggedIn
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public \App\Models\User $user;
|
||||
public User $user;
|
||||
|
||||
public string $ip;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*/
|
||||
public function __construct(\App\Models\User $user, string $ip = '')
|
||||
public function __construct(User $user, string $ip = '')
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->ip = $ip;
|
||||
|
||||
@@ -5,6 +5,11 @@ declare(strict_types=1);
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Session\TokenMismatchException;
|
||||
use Spatie\Permission\Exceptions\UnauthorizedException;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
@@ -46,25 +51,25 @@ class Handler extends ExceptionHandler
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Throwable
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function report(\Throwable $exception)
|
||||
public function report(Throwable $exception)
|
||||
{
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||
* @param Request $request
|
||||
* @return RedirectResponse|Response
|
||||
*
|
||||
* @throws \Throwable
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function render($request, \Throwable $exception)
|
||||
public function render($request, Throwable $exception)
|
||||
{
|
||||
if ($exception instanceof \Spatie\Permission\Exceptions\UnauthorizedException) {
|
||||
if ($exception instanceof UnauthorizedException) {
|
||||
abort(401);
|
||||
}
|
||||
if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
|
||||
if ($exception instanceof TokenMismatchException) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput($request->except(['password', 'password_confirmation']))
|
||||
|
||||
@@ -9,10 +9,14 @@ use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use GuzzleHttp\Cookie\SetCookie;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
use sspat\ESQuerySanitizer\Sanitizer;
|
||||
use STS\ZipStream\Builder;
|
||||
use STS\ZipStream\Facades\Zip as ZipStream;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
@@ -272,7 +276,7 @@ if (! function_exists('getStreamingZip')) {
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
function getStreamingZip(array $guids = []): STS\ZipStream\Builder
|
||||
function getStreamingZip(array $guids = []): Builder
|
||||
{
|
||||
$nzb = app(NzbService::class);
|
||||
$zipped = ZipStream::create(now()->format('Ymdhis').'.zip');
|
||||
@@ -581,15 +585,15 @@ if (! function_exists('userDate')) {
|
||||
// Parse the date in the app's timezone (which should be UTC)
|
||||
// If dates in DB are stored in server timezone, they'll be parsed correctly
|
||||
$appTimezone = config('app.timezone', 'UTC');
|
||||
$carbon = \Illuminate\Support\Carbon::parse($date, $appTimezone);
|
||||
$carbon = Carbon::parse($date, $appTimezone);
|
||||
|
||||
// If user is authenticated and has a timezone set, convert to it
|
||||
if (\Illuminate\Support\Facades\Auth::check() && \Illuminate\Support\Facades\Auth::user()->timezone) {
|
||||
$carbon->setTimezone(\Illuminate\Support\Facades\Auth::user()->timezone);
|
||||
if (Auth::check() && Auth::user()->timezone) {
|
||||
$carbon->setTimezone(Auth::user()->timezone);
|
||||
}
|
||||
|
||||
return $carbon->format($format);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
@@ -612,15 +616,15 @@ if (! function_exists('userDateDiffForHumans')) {
|
||||
// Parse the date in the app's timezone (which should be UTC)
|
||||
// If dates in DB are stored in server timezone, they'll be parsed correctly
|
||||
$appTimezone = config('app.timezone', 'UTC');
|
||||
$carbon = \Illuminate\Support\Carbon::parse($date, $appTimezone);
|
||||
$carbon = Carbon::parse($date, $appTimezone);
|
||||
|
||||
// If user is authenticated and has a timezone set, convert to it
|
||||
if (\Illuminate\Support\Facades\Auth::check() && \Illuminate\Support\Facades\Auth::user()->timezone) {
|
||||
$carbon->setTimezone(\Illuminate\Support\Facades\Auth::user()->timezone);
|
||||
if (Auth::check() && Auth::user()->timezone) {
|
||||
$carbon->setTimezone(Auth::user()->timezone);
|
||||
}
|
||||
|
||||
return $carbon->diffForHumans();
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
@@ -636,20 +640,20 @@ if (! function_exists('getAvailableTimezones')) {
|
||||
{
|
||||
$timezones = [];
|
||||
$regions = [
|
||||
'Africa' => \DateTimeZone::AFRICA,
|
||||
'America' => \DateTimeZone::AMERICA,
|
||||
'Antarctica' => \DateTimeZone::ANTARCTICA,
|
||||
'Arctic' => \DateTimeZone::ARCTIC,
|
||||
'Asia' => \DateTimeZone::ASIA,
|
||||
'Atlantic' => \DateTimeZone::ATLANTIC,
|
||||
'Australia' => \DateTimeZone::AUSTRALIA,
|
||||
'Europe' => \DateTimeZone::EUROPE,
|
||||
'Indian' => \DateTimeZone::INDIAN,
|
||||
'Pacific' => \DateTimeZone::PACIFIC,
|
||||
'Africa' => DateTimeZone::AFRICA,
|
||||
'America' => DateTimeZone::AMERICA,
|
||||
'Antarctica' => DateTimeZone::ANTARCTICA,
|
||||
'Arctic' => DateTimeZone::ARCTIC,
|
||||
'Asia' => DateTimeZone::ASIA,
|
||||
'Atlantic' => DateTimeZone::ATLANTIC,
|
||||
'Australia' => DateTimeZone::AUSTRALIA,
|
||||
'Europe' => DateTimeZone::EUROPE,
|
||||
'Indian' => DateTimeZone::INDIAN,
|
||||
'Pacific' => DateTimeZone::PACIFIC,
|
||||
];
|
||||
|
||||
foreach ($regions as $name => $region) {
|
||||
$timezones[$name] = \DateTimeZone::listIdentifiers($region);
|
||||
$timezones[$name] = DateTimeZone::listIdentifiers($region);
|
||||
}
|
||||
|
||||
return $timezones;
|
||||
@@ -792,12 +796,12 @@ if (! function_exists('fileInfo')) {
|
||||
* @param string $path Path to the file / folder to check.
|
||||
* @return string File info. Empty string on failure.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
function fileInfo(string $path): string
|
||||
{
|
||||
$magicPath = config('nntmux_settings.magic_file_path');
|
||||
if ($magicPath !== null && \Illuminate\Support\Facades\Process::run('which file')->successful()) {
|
||||
if ($magicPath !== null && Illuminate\Support\Facades\Process::run('which file')->successful()) {
|
||||
$magicSwitch = " -m $magicPath";
|
||||
$output = runCmd('file'.$magicSwitch.' -b "'.$path.'"');
|
||||
} else {
|
||||
@@ -874,9 +878,9 @@ if (! function_exists('showApiError')) {
|
||||
}
|
||||
|
||||
if (! function_exists('getRange')) {
|
||||
function getRange(string $tableName): \Illuminate\Contracts\Pagination\LengthAwarePaginator // @phpstan-ignore missingType.generics
|
||||
function getRange(string $tableName): LengthAwarePaginator // @phpstan-ignore missingType.generics
|
||||
{
|
||||
$range = \Illuminate\Support\Facades\DB::table($tableName);
|
||||
$range = DB::table($tableName);
|
||||
|
||||
return $range->orderByDesc('created_at')->paginate(config('nntmux.items_per_page'));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method static \Illuminate\Support\Collection getCategorizers()
|
||||
* @method static CategorizationPipeline addCategorizer(\App\Services\Categorization\Contracts\CategorizerInterface $categorizer)
|
||||
*
|
||||
* @see \App\Services\Categorization\CategorizationPipeline
|
||||
* @see CategorizationPipeline
|
||||
*/
|
||||
class Categorization extends Facade // @phpstan-ignore missingType.iterableValue, missingType.generics
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Mailerlite\LaravelElasticsearch\Manager;
|
||||
|
||||
/**
|
||||
* Elasticsearch Facade - provides static access to Elasticsearch client.
|
||||
@@ -16,7 +17,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method static array get(array $params)
|
||||
* @method static array deleteByQuery(array $params)
|
||||
*
|
||||
* @see \Mailerlite\LaravelElasticsearch\Manager
|
||||
* @see Manager
|
||||
*/
|
||||
class Elasticsearch extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method static array searchReleasesByCategory(array $categoryIds, int $limit = 1000)
|
||||
* @method static array searchReleasesWithCategoryFilter(string $searchTerm, array $categoryIds = [], int $limit = 1000)
|
||||
*
|
||||
* @see \App\Services\Search\SearchService
|
||||
* @see SearchService
|
||||
*/
|
||||
class Search extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method static \Illuminate\Support\Collection getPipes()
|
||||
* @method static array getStats()
|
||||
*
|
||||
* @see \App\Services\TvProcessing\TvProcessingPipeline
|
||||
* @see TvProcessingPipeline
|
||||
*/
|
||||
class TvProcessing extends Facade // @phpstan-ignore missingType.iterableValue, missingType.generics
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Facades;
|
||||
|
||||
use App\Services\YencService;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
@@ -16,7 +17,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method static string encode(string $data, string $filename, int $lineLength = 128, bool $includeCrc32 = true)
|
||||
* @method static array|null extractMetadata(string $text)
|
||||
*
|
||||
* @see \App\Services\YencService
|
||||
* @see YencService
|
||||
*/
|
||||
class Yenc extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
@@ -25,6 +26,6 @@ class Yenc extends Facade // @phpstan-ignore missingType.iterableValue
|
||||
*/
|
||||
protected static function getFacadeAccessor(): string
|
||||
{
|
||||
return \App\Services\YencService::class;
|
||||
return YencService::class;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ use App\Enums\BlacklistConstants;
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Category;
|
||||
use App\Services\BlacklistService;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminBlacklistController extends BasePageController
|
||||
@@ -34,7 +36,7 @@ class AdminBlacklistController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Contracts\View\View|void
|
||||
* @return RedirectResponse|View|void
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Category;
|
||||
use App\Models\RootCategory;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminCategoryController extends BasePageController
|
||||
{
|
||||
@@ -31,7 +33,7 @@ class AdminCategoryController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
@@ -88,7 +90,7 @@ class AdminCategoryController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
@@ -141,7 +143,7 @@ class AdminCategoryController extends BasePageController
|
||||
/**
|
||||
* Delete a category.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @return RedirectResponse
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Category;
|
||||
use App\Services\RegexService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminCategoryRegexesController extends BasePageController
|
||||
{
|
||||
@@ -35,7 +37,7 @@ class AdminCategoryRegexesController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Category;
|
||||
use App\Services\RegexService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminCollectionRegexesController extends BasePageController
|
||||
{
|
||||
@@ -35,7 +37,7 @@ class AdminCollectionRegexesController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,11 @@ namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Content;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminContentController extends BasePageController
|
||||
{
|
||||
@@ -35,7 +39,7 @@ class AdminContentController extends BasePageController
|
||||
/**
|
||||
* Show form to create or edit content.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||
* @return \Illuminate\Contracts\Foundation\Application|Application|RedirectResponse|Redirector|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,9 @@ namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\UsenetGroup;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminGroupController extends BasePageController
|
||||
{
|
||||
@@ -43,7 +45,7 @@ class AdminGroupController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Models\User;
|
||||
use App\Services\InvitationService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminInvitationController extends BasePageController
|
||||
@@ -132,7 +133,7 @@ class AdminInvitationController extends BasePageController
|
||||
*/
|
||||
private function getOverallStats(): array
|
||||
{
|
||||
return \Illuminate\Support\Facades\Cache::remember('admin_invitation_stats', 300, function () {
|
||||
return Cache::remember('admin_invitation_stats', 300, function () {
|
||||
return [
|
||||
'total' => Invitation::count(),
|
||||
'pending' => Invitation::valid()->count(),
|
||||
@@ -158,7 +159,7 @@ class AdminInvitationController extends BasePageController
|
||||
*/
|
||||
private function getTopInviters(int $limit = 10): array
|
||||
{
|
||||
return \Illuminate\Support\Facades\Cache::remember('admin_top_inviters', 300, function () use ($limit) {
|
||||
return Cache::remember('admin_top_inviters', 300, function () use ($limit) {
|
||||
return User::select('users.*')
|
||||
->selectRaw('COUNT(invitations.id) as total_invitations')
|
||||
->selectRaw('COUNT(CASE WHEN invitations.used_at IS NOT NULL THEN 1 END) as successful_invitations')
|
||||
|
||||
@@ -8,7 +8,9 @@ use App\Http\Controllers\BasePageController;
|
||||
use App\Models\MovieInfo;
|
||||
use App\Models\Release;
|
||||
use App\Services\MovieService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminMovieController extends BasePageController
|
||||
{
|
||||
@@ -39,7 +41,7 @@ class AdminMovieController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
@@ -104,7 +106,7 @@ class AdminMovieController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Category;
|
||||
use App\Services\RegexService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminReleaseNamingRegexesController extends BasePageController
|
||||
{
|
||||
@@ -38,7 +40,7 @@ class AdminReleaseNamingRegexesController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -63,7 +63,7 @@ class AdminReleaseReportController extends BasePageController
|
||||
$report = ReleaseReport::with('release')->findOrFail($id);
|
||||
|
||||
if ($report->release) {
|
||||
/** @var \App\Models\Release $release */
|
||||
/** @var Release $release */
|
||||
$release = $report->release;
|
||||
$releaseName = $release->searchname;
|
||||
$releaseId = $report->releases_id;
|
||||
|
||||
@@ -8,7 +8,11 @@ use App\Http\Controllers\BasePageController;
|
||||
use App\Models\Category;
|
||||
use App\Models\Release;
|
||||
use App\Services\Releases\ReleaseManagementService;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminReleasesController extends BasePageController
|
||||
{
|
||||
@@ -40,7 +44,7 @@ class AdminReleasesController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
|
||||
* @return \Illuminate\Contracts\Foundation\Application|Application|RedirectResponse|Redirector|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -11,12 +11,14 @@ use App\Models\ReleaseStat;
|
||||
use App\Models\RoleStat;
|
||||
use App\Models\Settings;
|
||||
use App\Models\SignupStat;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AdminSiteController extends BasePageController
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
* @return RedirectResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,7 @@ use App\Services\RegistrationStatusService;
|
||||
use App\Services\Releases\ReleaseBrowseService;
|
||||
use App\Services\Releases\ReleaseSearchService;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -488,7 +489,7 @@ class ApiController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Application|\Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Foundation\Application|Response|int
|
||||
* @return Application|ResponseFactory|\Illuminate\Foundation\Application|Response|int
|
||||
*/
|
||||
public function maxAge(Request $request)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\Release;
|
||||
use App\Models\ReleaseInform;
|
||||
use App\Models\User;
|
||||
use App\Services\NameFixing\ReleaseUpdateService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ApiInformController extends Controller
|
||||
@@ -19,7 +20,7 @@ class ApiInformController extends Controller
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function release(Request $request): \Illuminate\Http\JsonResponse
|
||||
public function release(Request $request): JsonResponse
|
||||
{
|
||||
$releaseObName = $request->has('relo') && ! empty($request->input('relo')) ? $request->input('relo') : '';
|
||||
$releasePrName = $request->has('relp') && ! empty($request->input('relp')) ? $request->input('relp') : '';
|
||||
|
||||
@@ -17,9 +17,11 @@ use App\Services\Releases\ReleaseSearchService;
|
||||
use App\Transformers\ApiTransformer;
|
||||
use App\Transformers\CategoryTransformer;
|
||||
use App\Transformers\DetailsTransformer;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
@@ -305,7 +307,7 @@ class ApiV2Controller extends BasePageController
|
||||
return response()->json($response);
|
||||
}
|
||||
|
||||
public function getNzb(Request $request): \Illuminate\Foundation\Application|JsonResponse|\Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
|
||||
public function getNzb(Request $request): Application|JsonResponse|Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
|
||||
{
|
||||
$user = $this->resolveUser($request);
|
||||
if (! $user) {
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\Release;
|
||||
use App\Services\Releases\ReleaseBrowseService;
|
||||
use App\Services\Releases\ReleaseSearchService;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -161,7 +162,7 @@ class RSS extends ApiController
|
||||
$cacheKey = 'rss_trending_movies_48h';
|
||||
|
||||
return Cache::remember($cacheKey, 3600, function () {
|
||||
$fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48);
|
||||
$fortyEightHoursAgo = Carbon::now()->subHours(48);
|
||||
|
||||
// First get the top 15 movies by download count
|
||||
$topMovies = DB::table('movieinfo as m')
|
||||
@@ -225,7 +226,7 @@ class RSS extends ApiController
|
||||
$cacheKey = 'rss_trending_shows_48h';
|
||||
|
||||
return Cache::remember($cacheKey, 3600, function () {
|
||||
$fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48);
|
||||
$fortyEightHoursAgo = Carbon::now()->subHours(48);
|
||||
|
||||
// First get the top 15 TV shows by download count
|
||||
$topShows = DB::table('videos as v')
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace App\Http\Controllers\Auth;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Jobs\SendPasswordForgottenEmail;
|
||||
use App\Models\User;
|
||||
use App\Support\CaptchaHelper;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -53,16 +54,16 @@ class ForgotPasswordController extends Controller
|
||||
return redirect()
|
||||
->route('forgottenpassword')
|
||||
->withErrors(['error' => 'Missing parameter (email and/or apikey) to send password reset'])
|
||||
->withInput($request->except(\App\Support\CaptchaHelper::getResponseFieldName()));
|
||||
->withInput($request->except(CaptchaHelper::getResponseFieldName()));
|
||||
}
|
||||
|
||||
if (\App\Support\CaptchaHelper::isEnabled()) {
|
||||
$validate = Validator::make($request->all(), \App\Support\CaptchaHelper::getValidationRules());
|
||||
if (CaptchaHelper::isEnabled()) {
|
||||
$validate = Validator::make($request->all(), CaptchaHelper::getValidationRules());
|
||||
if ($validate->fails()) {
|
||||
return redirect()
|
||||
->route('forgottenpassword')
|
||||
->withErrors(['error' => 'Captcha validation failed.'])
|
||||
->withInput($request->except(\App\Support\CaptchaHelper::getResponseFieldName()));
|
||||
->withInput($request->except(CaptchaHelper::getResponseFieldName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +73,7 @@ class ForgotPasswordController extends Controller
|
||||
return redirect()
|
||||
->route('forgottenpassword')
|
||||
->withErrors(['error' => 'The email or apikey are not recognised.'])
|
||||
->withInput($request->except(\App\Support\CaptchaHelper::getResponseFieldName()));
|
||||
->withInput($request->except(CaptchaHelper::getResponseFieldName()));
|
||||
}
|
||||
|
||||
// Check if user is soft deleted
|
||||
@@ -81,7 +82,7 @@ class ForgotPasswordController extends Controller
|
||||
return redirect()
|
||||
->route('forgottenpassword')
|
||||
->withErrors(['error' => 'This account has been deactivated.'])
|
||||
->withInput($request->except(\App\Support\CaptchaHelper::getResponseFieldName()));
|
||||
->withInput($request->except(CaptchaHelper::getResponseFieldName()));
|
||||
}
|
||||
|
||||
// Generate a forgottenpassword guid, store it in the user table
|
||||
|
||||
@@ -14,6 +14,7 @@ use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -64,7 +65,7 @@ class LoginController extends Controller
|
||||
/**
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
public function login(LoginLoginRequest $request): \Illuminate\Foundation\Application|\Illuminate\Routing\Redirector|Application|RedirectResponse
|
||||
public function login(LoginLoginRequest $request): \Illuminate\Foundation\Application|Redirector|Application|RedirectResponse
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'username' => ['required'],
|
||||
@@ -201,7 +202,7 @@ class LoginController extends Controller
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
public function logout(Request $request): \Illuminate\Routing\Redirector|RedirectResponse
|
||||
public function logout(Request $request): Redirector|RedirectResponse
|
||||
{
|
||||
// Save 2FA trusted device cookie value before logout
|
||||
$trustedDeviceCookie = $request->cookie('2fa_trusted_device');
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Release;
|
||||
use App\Models\UsersRelease;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -33,7 +34,7 @@ class CartController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
public function store(Request $request): RedirectResponse|JsonResponse
|
||||
{
|
||||
$guids = explode(',', $request->input('id'));
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Genre;
|
||||
use App\Services\ConsoleService;
|
||||
use App\Services\GenreService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -78,7 +79,7 @@ class ConsoleController extends BasePageController
|
||||
$genres = $gen->getGenres((string) GenreService::CONSOLE_TYPE, true);
|
||||
$tmpgnr = [];
|
||||
foreach ($genres as $gn) {
|
||||
/** @var \App\Models\Genre $gn */
|
||||
/** @var Genre $gn */
|
||||
$tmpgnr[$gn->id] = $gn->title;
|
||||
}
|
||||
$genre = ($request->has('genre') && isset($tmpgnr[$request->input('genre')])) ? $request->input('genre') : '';
|
||||
|
||||
@@ -6,11 +6,14 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\ContactContactURequest;
|
||||
use App\Jobs\SendContactUsEmail;
|
||||
use App\Support\CaptchaHelper;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ContactUsController extends BasePageController
|
||||
{
|
||||
/**
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function contact(ContactContactURequest $request): mixed
|
||||
{
|
||||
@@ -22,7 +25,7 @@ class ContactUsController extends BasePageController
|
||||
$mailTo = config('mail.from.address');
|
||||
$mailBody = 'Values submitted from contact form: ';
|
||||
|
||||
$captchaFieldName = \App\Support\CaptchaHelper::getResponseFieldName();
|
||||
$captchaFieldName = CaptchaHelper::getResponseFieldName();
|
||||
foreach ($request->all() as $key => $value) {
|
||||
if ($key !== 'submit' && $key !== '_token' && $key !== 'g-recaptcha-response' && $key !== 'cf-turnstile-response') {
|
||||
$mailBody .= "$key : $value".PHP_EOL;
|
||||
@@ -39,7 +42,7 @@ class ContactUsController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
* @return View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -6,14 +6,16 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Content;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ContentController extends BasePageController
|
||||
{
|
||||
/**
|
||||
* Display content page(s).
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
|
||||
* @return JsonResponse|View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
@@ -21,6 +21,7 @@ use App\Services\ConsoleService;
|
||||
use App\Services\GamesService;
|
||||
use App\Services\MovieService;
|
||||
use App\Services\MusicService;
|
||||
use App\Services\PopulateAniListService;
|
||||
use App\Services\ReleaseExtraService;
|
||||
use App\Services\Releases\ReleaseSearchService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -63,7 +64,7 @@ class DetailsController extends BasePageController
|
||||
}
|
||||
|
||||
$nfoData = ReleaseNfo::getReleaseNfo($data['id']);
|
||||
/** @var \App\Models\ReleaseNfo|null $nfoData */
|
||||
/** @var ReleaseNfo|null $nfoData */
|
||||
$nfo = $nfoData ? $nfoData->nfo : null;
|
||||
$reVideo = $this->releaseExtraService->getVideo($data['id']);
|
||||
$reAudio = $this->releaseExtraService->getAudio($data['id']);
|
||||
@@ -136,7 +137,7 @@ class DetailsController extends BasePageController
|
||||
if (empty($AniDBAPIArray->country) && empty($AniDBAPIArray->media_type)) {
|
||||
// Fetch fresh data from AniList if country/media_type is missing
|
||||
try {
|
||||
$palist = new \App\Services\PopulateAniListService;
|
||||
$palist = new PopulateAniListService;
|
||||
$palist->populateTable('info', $anilistId);
|
||||
// Refresh the data
|
||||
$AniDBAPIArray = (new AnidbService)->getAnimeInfo($data['anidbid']);
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Genre;
|
||||
use App\Services\GamesService;
|
||||
use App\Services\GenreService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -44,7 +45,7 @@ class GamesController extends BasePageController
|
||||
$genres = $gen->getGenres((string) GenreService::GAME_TYPE, true);
|
||||
$tmpgnr = [];
|
||||
foreach ($genres as $gn) {
|
||||
/** @var \App\Models\Genre $gn */
|
||||
/** @var Genre $gn */
|
||||
$tmpgnr[$gn->id] = $gn->title;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use STS\ZipStream\Builder;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class GetNzbController extends BasePageController
|
||||
@@ -28,7 +29,7 @@ class GetNzbController extends BasePageController
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getNzb(Request $request, ?string $guid = null): JsonResponse|Response|StreamedResponse|\STS\ZipStream\Builder
|
||||
public function getNzb(Request $request, ?string $guid = null): JsonResponse|Response|StreamedResponse|Builder
|
||||
{
|
||||
// Normalize guid parameter
|
||||
$this->normalizeGuidParameter($request, $guid);
|
||||
@@ -188,7 +189,7 @@ class GetNzbController extends BasePageController
|
||||
string $userName,
|
||||
int $maxDownloads,
|
||||
string $releaseId
|
||||
): JsonResponse|Response|StreamedResponse|\STS\ZipStream\Builder {
|
||||
): JsonResponse|Response|StreamedResponse|Builder {
|
||||
$guids = explode(',', $releaseId);
|
||||
$guidCount = \count($guids);
|
||||
|
||||
|
||||
@@ -7,7 +7,12 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Category;
|
||||
use App\Services\MovieBrowseService;
|
||||
use App\Services\MovieService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class MovieController extends BasePageController
|
||||
{
|
||||
@@ -153,7 +158,7 @@ class MovieController extends BasePageController
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
|
||||
* @return JsonResponse|View
|
||||
*/
|
||||
public function showTrailer(Request $request)
|
||||
{
|
||||
@@ -201,13 +206,13 @@ class MovieController extends BasePageController
|
||||
$cacheKey = 'trending_movies_top_15_48h';
|
||||
|
||||
// Get trending movies from cache or calculate (refresh every hour)
|
||||
$trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function () {
|
||||
$trendingMovies = Cache::remember($cacheKey, 3600, function () {
|
||||
// Calculate timestamp for 48 hours ago
|
||||
$fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48);
|
||||
$fortyEightHoursAgo = Carbon::now()->subHours(48);
|
||||
|
||||
// Get movies with their download counts from last 48 hours
|
||||
// Join with user_downloads to get actual download timestamps
|
||||
$query = \Illuminate\Support\Facades\DB::table('movieinfo as m')
|
||||
$query = DB::table('movieinfo as m')
|
||||
->join('releases as r', 'm.imdbid', '=', 'r.imdbid')
|
||||
->leftJoin('user_downloads as ud', 'r.id', '=', 'ud.releases_id')
|
||||
->select([
|
||||
@@ -220,8 +225,8 @@ class MovieController extends BasePageController
|
||||
'm.cover',
|
||||
'm.tmdbid',
|
||||
'm.traktid',
|
||||
\Illuminate\Support\Facades\DB::raw('COUNT(DISTINCT ud.id) as total_downloads'),
|
||||
\Illuminate\Support\Facades\DB::raw('COUNT(DISTINCT r.id) as release_count'),
|
||||
DB::raw('COUNT(DISTINCT ud.id) as total_downloads'),
|
||||
DB::raw('COUNT(DISTINCT r.id) as release_count'),
|
||||
])
|
||||
->where('m.title', '!=', '')
|
||||
->where('m.imdbid', '!=', '0000000')
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Genre;
|
||||
use App\Services\GenreService;
|
||||
use App\Services\MusicService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -58,7 +59,7 @@ class MusicController extends BasePageController
|
||||
$genres = $gen->getGenres((string) GenreService::MUSIC_TYPE, true);
|
||||
$tmpgnr = [];
|
||||
foreach ($genres as $gn) {
|
||||
/** @var \App\Models\Genre $gn */
|
||||
/** @var Genre $gn */
|
||||
$tmpgnr[$gn->id] = $gn->title;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,15 +6,20 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\Disable2faPasswordSecurityRequest;
|
||||
use App\Models\PasswordSecurity;
|
||||
use App\Models\User;
|
||||
use App\Services\PasswordBreachService;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;
|
||||
use PragmaRX\Google2FA\Exceptions\InvalidCharactersException;
|
||||
use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException;
|
||||
use PragmaRX\Google2FALaravel\Facade as Google2FA;
|
||||
|
||||
class PasswordSecurityController extends Controller
|
||||
@@ -44,9 +49,9 @@ class PasswordSecurityController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException
|
||||
* @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException
|
||||
* @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException
|
||||
* @throws IncompatibleWithGoogleAuthenticatorException
|
||||
* @throws InvalidCharactersException
|
||||
* @throws SecretKeyTooShortException
|
||||
*/
|
||||
public function generate2faSecret(Request $request): RedirectResponse
|
||||
{
|
||||
@@ -74,9 +79,9 @@ class PasswordSecurityController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException
|
||||
* @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException
|
||||
* @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException
|
||||
* @throws IncompatibleWithGoogleAuthenticatorException
|
||||
* @throws InvalidCharactersException
|
||||
* @throws SecretKeyTooShortException
|
||||
*/
|
||||
public function enable2fa(Request $request): RedirectResponse
|
||||
{
|
||||
@@ -118,7 +123,7 @@ class PasswordSecurityController extends Controller
|
||||
return redirect()->to('profileedit#security')->with('error_2fa', 'Unable to cancel 2FA setup.');
|
||||
}
|
||||
|
||||
public function disable2fa(Disable2faPasswordSecurityRequest $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
|
||||
public function disable2fa(Disable2faPasswordSecurityRequest $request): Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
@@ -158,7 +163,7 @@ class PasswordSecurityController extends Controller
|
||||
}
|
||||
|
||||
$userId = $request->session()->get('2fa:user:id');
|
||||
$user = \App\Models\User::find($userId);
|
||||
$user = User::find($userId);
|
||||
|
||||
if (! $user || ! $user->passwordSecurity) {
|
||||
$request->session()->forget('2fa:user:id');
|
||||
@@ -270,7 +275,7 @@ class PasswordSecurityController extends Controller
|
||||
$userId = $request->session()->get('2fa:user:id');
|
||||
|
||||
// Get the user
|
||||
$user = \App\Models\User::find($userId);
|
||||
$user = User::find($userId);
|
||||
if (! $user) {
|
||||
$request->session()->forget('2fa:user:id');
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class ForceJsonOnAPI
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
* @param Closure(Request): (Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ class SetUserTimezone
|
||||
* with database operations and helper functions. Instead, the timezone
|
||||
* conversion happens in the userDate() and userDateDiffForHumans() helpers.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
* @param Closure(Request): (Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\AnidbInfo;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* AniDB API Resource for transforming anime data.
|
||||
*
|
||||
* @mixin \App\Models\AnidbInfo
|
||||
* @mixin AnidbInfo
|
||||
*/
|
||||
class AnidbResource extends JsonResource
|
||||
{
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\BookInfo;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* Book API Resource for transforming book data.
|
||||
*
|
||||
* @mixin \App\Models\BookInfo
|
||||
* @mixin BookInfo
|
||||
*/
|
||||
class BookResource extends JsonResource
|
||||
{
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\MovieInfo;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* Movie API Resource for transforming movie data.
|
||||
*
|
||||
* @mixin \App\Models\MovieInfo
|
||||
* @mixin MovieInfo
|
||||
*/
|
||||
class MovieResource extends JsonResource
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Mail\AccountWillExpire;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
@@ -18,12 +19,12 @@ class SendAccountWillExpireEmail implements ShouldQueue
|
||||
|
||||
private int $days;
|
||||
|
||||
private \App\Models\User $user;
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(\App\Models\User $user, int $days)
|
||||
public function __construct(User $user, int $days)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->days = $days;
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Mail\SendInvite;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
@@ -20,12 +21,12 @@ class SendInviteEmail implements ShouldQueue
|
||||
|
||||
private string $url;
|
||||
|
||||
private \App\Models\User $user;
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* SendInviteEmail constructor.
|
||||
*/
|
||||
public function __construct(string $email, \App\Models\User $user, string $url)
|
||||
public function __construct(string $email, User $user, string $url)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->user = $user;
|
||||
|
||||
@@ -26,7 +26,7 @@ class LoginForm extends Form
|
||||
/**
|
||||
* Attempt to authenticate the request's credentials.
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public function authenticate(): void
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
@@ -13,7 +14,7 @@ class AccountDeleted extends Mailable
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Database\Eloquent\Model|null|object|static
|
||||
* @var Model|null|object|static
|
||||
*/
|
||||
private $user;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -12,7 +13,7 @@ class AccountExpired extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public \App\Models\User $user;
|
||||
public User $user;
|
||||
|
||||
private mixed $siteEmail;
|
||||
|
||||
@@ -21,7 +22,7 @@ class AccountExpired extends Mailable
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(\App\Models\User $user)
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->siteEmail = config('mail.from.address');
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -14,7 +15,7 @@ class AccountWillExpire extends Mailable
|
||||
|
||||
private int $days;
|
||||
|
||||
private \App\Models\User $user;
|
||||
private User $user;
|
||||
|
||||
private mixed $siteEmail;
|
||||
|
||||
@@ -23,7 +24,7 @@ class AccountWillExpire extends Mailable
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(\App\Models\User $user, int $days)
|
||||
public function __construct(User $user, int $days)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->days = $days;
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace App\Mail;
|
||||
use App\Models\Invitation;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -55,7 +56,7 @@ class InvitationMail extends Mailable
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -13,7 +14,7 @@ class NewAccountCreatedEmail extends Mailable
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var \App\Models\User
|
||||
* @var User
|
||||
*/
|
||||
private $user;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -16,7 +17,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property int $episode_no Numeric version of episode (leave 0 for combined episodes).
|
||||
* @property string $episode_title Title of the episode (en, x-jat)
|
||||
* @property string $airdate
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AnidbInfo[] $info
|
||||
* @property-read Collection|AnidbInfo[] $info
|
||||
* @property-read AnidbTitle $title
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnidbEpisode whereAirdate($value)
|
||||
@@ -56,7 +57,7 @@ class AnidbEpisode extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\AnidbTitle, $this>
|
||||
* @return BelongsTo<AnidbTitle, $this>
|
||||
*/
|
||||
public function title(): BelongsTo
|
||||
{
|
||||
@@ -64,7 +65,7 @@ class AnidbEpisode extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\AnidbInfo, $this>
|
||||
* @return HasMany<AnidbInfo, $this>
|
||||
*/
|
||||
public function info(): HasMany
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ class AnidbInfo extends Model
|
||||
/**
|
||||
* Get the title associated with this info.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\AnidbTitle, $this>
|
||||
* @return BelongsTo<AnidbTitle, $this>
|
||||
*/
|
||||
public function title(): BelongsTo
|
||||
{
|
||||
@@ -97,7 +97,7 @@ class AnidbInfo extends Model
|
||||
/**
|
||||
* Get the releases associated with this anime.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function releases(): HasMany
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
@@ -14,7 +15,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property string $type type of title.
|
||||
* @property string $lang
|
||||
* @property string $title
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AnidbInfo[] $info
|
||||
* @property-read Collection|AnidbInfo[] $info
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnidbTitle whereAnidbid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnidbTitle whereLang($value)
|
||||
@@ -52,7 +53,7 @@ class AnidbTitle extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\AnidbInfo, $this>
|
||||
* @return HasMany<AnidbInfo, $this>
|
||||
*/
|
||||
public function info(): HasMany
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Laravel\Scout\Searchable;
|
||||
@@ -25,8 +26,8 @@ use Laravel\Scout\Searchable;
|
||||
* @property string|null $overview
|
||||
* @property string $genre
|
||||
* @property bool $cover
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookInfo whereAsin($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookInfo whereAuthor($value)
|
||||
@@ -86,7 +87,7 @@ class BookInfo extends Model
|
||||
/**
|
||||
* Get the releases associated with this book.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function releases(): HasMany
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -22,9 +23,9 @@ use Illuminate\Support\Facades\DB;
|
||||
* @property int $minsizetoformrelease
|
||||
* @property int $maxsizetoformrelease
|
||||
* @property int|null $count Computed count from aggregate queries
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Category[] $children
|
||||
* @property-read Collection|Category[] $children
|
||||
* @property-read Category|null $parent
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Release[] $releases
|
||||
* @property-read Collection|Release[] $releases
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Category whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Category whereDisablepreview($value)
|
||||
@@ -268,7 +269,7 @@ class Category extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function releases(): HasMany
|
||||
{
|
||||
@@ -276,7 +277,7 @@ class Category extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\RootCategory, $this>
|
||||
* @return BelongsTo<RootCategory, $this>
|
||||
*/
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
@@ -589,7 +590,7 @@ class Category extends Model
|
||||
* @param array<string, mixed> $excludedCats
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public static function getCategories(bool $activeOnly = false, array $excludedCats = []): \Illuminate\Database\Eloquent\Collection // @phpstan-ignore missingType.generics
|
||||
public static function getCategories(bool $activeOnly = false, array $excludedCats = []): Collection // @phpstan-ignore missingType.generics
|
||||
{
|
||||
$sql = self::query()
|
||||
->with('parent')
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -24,8 +25,8 @@ use Laravel\Scout\Searchable;
|
||||
* @property string|null $releasedate
|
||||
* @property string|null $review
|
||||
* @property bool $cover
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConsoleInfo whereAsin($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConsoleInfo whereCover($value)
|
||||
@@ -87,7 +88,7 @@ class ConsoleInfo extends Model
|
||||
/**
|
||||
* Get the genre for the console info.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Genre, $this>
|
||||
* @return BelongsTo<Genre, $this>
|
||||
*/
|
||||
public function genre(): BelongsTo
|
||||
{
|
||||
@@ -97,7 +98,7 @@ class ConsoleInfo extends Model
|
||||
/**
|
||||
* Get the releases for the console info.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function releases(): HasMany
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ class DnzbFailure extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
@@ -57,7 +57,7 @@ class DnzbFailure extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -19,8 +20,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property bool $locked
|
||||
* @property bool $sticky
|
||||
* @property int $replies
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Forumpost whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Forumpost whereForumid($value)
|
||||
|
||||
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -25,10 +27,10 @@ use Laravel\Scout\Searchable;
|
||||
* @property bool $backdrop
|
||||
* @property string $trailer
|
||||
* @property string $classused
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Genre|null $genre
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|Release[] $releases
|
||||
* @property-read Collection|Release[] $releases
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\GamesInfo whereAsin($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\GamesInfo whereBackdrop($value)
|
||||
@@ -81,7 +83,7 @@ class GamesInfo extends Model
|
||||
/**
|
||||
* Get the genre for this game.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Genre, $this>
|
||||
* @return BelongsTo<Genre, $this>
|
||||
*/
|
||||
public function genre(): BelongsTo
|
||||
{
|
||||
@@ -91,7 +93,7 @@ class GamesInfo extends Model
|
||||
/**
|
||||
* Get the releases for this game.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function releases(): HasMany
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ use Illuminate\Support\Facades\DB;
|
||||
* @property string $title
|
||||
* @property int|null $type
|
||||
* @property bool $disabled
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\MusicInfo[] $music
|
||||
* @property-read Collection|MusicInfo[] $music
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Genre whereDisabled($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Genre whereId($value)
|
||||
@@ -48,7 +48,7 @@ class Genre extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\MusicInfo, $this>
|
||||
* @return HasMany<MusicInfo, $this>
|
||||
*/
|
||||
public function music(): HasMany
|
||||
{
|
||||
@@ -56,7 +56,7 @@ class Genre extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\ConsoleInfo, $this>
|
||||
* @return HasMany<ConsoleInfo, $this>
|
||||
*/
|
||||
public function consoleInfo(): HasMany
|
||||
{
|
||||
@@ -64,7 +64,7 @@ class Genre extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\GamesInfo, $this>
|
||||
* @return HasMany<GamesInfo, $this>
|
||||
*/
|
||||
public function gamesInfo(): HasMany
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
@@ -16,15 +17,15 @@ use Illuminate\Support\Str;
|
||||
* @property string $token
|
||||
* @property string $email
|
||||
* @property int $invited_by
|
||||
* @property \Illuminate\Support\Carbon $expires_at
|
||||
* @property \Illuminate\Support\Carbon|null $used_at
|
||||
* @property Carbon $expires_at
|
||||
* @property Carbon|null $used_at
|
||||
* @property int|null $used_by
|
||||
* @property bool $is_active
|
||||
* @property array|null $metadata
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\Models\User $invitedBy
|
||||
* @property-read \App\Models\User|null $usedBy
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User $invitedBy
|
||||
* @property-read User|null $usedBy
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Invitation newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Invitation newQuery()
|
||||
@@ -78,7 +79,7 @@ class Invitation extends Model // @phpstan-ignore missingType.iterableValue
|
||||
/**
|
||||
* Get the user who created this invitation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function invitedBy(): BelongsTo
|
||||
{
|
||||
@@ -88,7 +89,7 @@ class Invitation extends Model // @phpstan-ignore missingType.iterableValue
|
||||
/**
|
||||
* Get the user who used this invitation
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function usedBy(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
@@ -27,8 +28,8 @@ use Illuminate\Support\Facades\Cache;
|
||||
* @property string $language
|
||||
* @property bool $cover
|
||||
* @property bool $backdrop
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string $trailer
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\MovieInfo whereActors($value)
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Laravel\Scout\Searchable;
|
||||
@@ -24,8 +25,8 @@ use Laravel\Scout\Searchable;
|
||||
* @property int|null $genres_id
|
||||
* @property string|null $tracks
|
||||
* @property bool $cover
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int|null $_totalcount Computed total count from aggregate queries
|
||||
* @property-read Genre|null $genre
|
||||
*
|
||||
@@ -73,7 +74,7 @@ class MusicInfo extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Genre, $this>
|
||||
* @return BelongsTo<Genre, $this>
|
||||
*/
|
||||
public function genre(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ class PasswordSecurity extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ class Predb extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\PredbHash, $this>
|
||||
* @return HasMany<PredbHash, $this>
|
||||
*/
|
||||
public function hash(): HasMany
|
||||
{
|
||||
@@ -94,7 +94,7 @@ class Predb extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function release(): HasMany
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ class PredbHash extends Model
|
||||
protected $primaryKey = 'hash';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Predb, $this>
|
||||
* @return BelongsTo<Predb, $this>
|
||||
*/
|
||||
public function predb(): BelongsTo
|
||||
{
|
||||
|
||||
+18
-16
@@ -6,11 +6,13 @@ namespace App\Models;
|
||||
|
||||
use App\Facades\Search;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -63,7 +65,7 @@ class Release extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\UsenetGroup, $this>
|
||||
* @return BelongsTo<UsenetGroup, $this>
|
||||
*/
|
||||
public function group(): BelongsTo
|
||||
{
|
||||
@@ -71,7 +73,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserDownload, $this>
|
||||
* @return HasMany<UserDownload, $this>
|
||||
*/
|
||||
public function download(): HasMany
|
||||
{
|
||||
@@ -79,7 +81,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UsersRelease, $this>
|
||||
* @return HasMany<UsersRelease, $this>
|
||||
*/
|
||||
public function userRelease(): HasMany
|
||||
{
|
||||
@@ -87,7 +89,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\ReleaseFile, $this>
|
||||
* @return HasMany<ReleaseFile, $this>
|
||||
*/
|
||||
public function file(): HasMany
|
||||
{
|
||||
@@ -95,7 +97,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Category, $this>
|
||||
* @return BelongsTo<Category, $this>
|
||||
*/
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
@@ -103,7 +105,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Predb, $this>
|
||||
* @return BelongsTo<Predb, $this>
|
||||
*/
|
||||
public function predb(): BelongsTo
|
||||
{
|
||||
@@ -111,7 +113,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\DnzbFailure, $this>
|
||||
* @return HasMany<DnzbFailure, $this>
|
||||
*/
|
||||
public function failed(): HasMany
|
||||
{
|
||||
@@ -119,7 +121,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\ReleaseNfo, $this>
|
||||
* @return HasOne<ReleaseNfo, $this>
|
||||
*/
|
||||
public function nfo(): HasOne
|
||||
{
|
||||
@@ -127,7 +129,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\ReleaseComment, $this>
|
||||
* @return HasMany<ReleaseComment, $this>
|
||||
*/
|
||||
public function comment(): HasMany
|
||||
{
|
||||
@@ -135,7 +137,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\ReleaseReport, $this>
|
||||
* @return HasMany<ReleaseReport, $this>
|
||||
*/
|
||||
public function reports(): HasMany
|
||||
{
|
||||
@@ -143,7 +145,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\ReleasesGroups, $this>
|
||||
* @return HasMany<ReleasesGroups, $this>
|
||||
*/
|
||||
public function releaseGroup(): HasMany
|
||||
{
|
||||
@@ -151,7 +153,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Video, $this>
|
||||
* @return BelongsTo<Video, $this>
|
||||
*/
|
||||
public function video(): BelongsTo
|
||||
{
|
||||
@@ -159,7 +161,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\VideoData, $this>
|
||||
* @return HasOne<VideoData, $this>
|
||||
*/
|
||||
public function videoData(): HasOne
|
||||
{
|
||||
@@ -167,7 +169,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\TvEpisode, $this>
|
||||
* @return BelongsTo<TvEpisode, $this>
|
||||
*/
|
||||
public function episode(): BelongsTo
|
||||
{
|
||||
@@ -338,7 +340,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Query\Builder[]|\Illuminate\Support\Collection|mixed
|
||||
* @return Builder[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Query\Builder[]|Collection|mixed
|
||||
*/
|
||||
public static function getReleases()
|
||||
{
|
||||
@@ -500,7 +502,7 @@ class Release extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Release|false|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\Illuminate\Database\Query\Builder|object|null
|
||||
* @return Release|false|Builder|Model|\Illuminate\Database\Query\Builder|object|null
|
||||
*/
|
||||
public static function getAlternate(string $guid, int $userid)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@@ -21,8 +22,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property string $text_hash
|
||||
* @property string $username
|
||||
* @property int $users_id
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $host
|
||||
* @property bool $shared
|
||||
* @property string $shareid
|
||||
@@ -67,7 +68,7 @@ class ReleaseComment extends Model
|
||||
protected $dateFormat = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
@@ -75,7 +76,7 @@ class ReleaseComment extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ class ReleaseNfo extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ class ReleaseReport extends Model
|
||||
/**
|
||||
* Get the release that was reported.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
@@ -85,7 +85,7 @@ class ReleaseReport extends Model
|
||||
/**
|
||||
* Get the user who reported the release.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -95,7 +95,7 @@ class ReleaseReport extends Model
|
||||
/**
|
||||
* Get the admin who reviewed the report.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function reviewer(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ class ReleasesGroups extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
@@ -74,7 +74,7 @@ class ReleasesGroups extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\UsenetGroup, $this>
|
||||
* @return BelongsTo<UsenetGroup, $this>
|
||||
*/
|
||||
public function group(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -5,14 +5,15 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* App\Models\RoleExpirationEmail.
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $users_id
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property int $day
|
||||
* @property int $week
|
||||
* @property int $month
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
@@ -22,7 +23,7 @@ use Spatie\Permission\Models\Role;
|
||||
* @property bool $is_active
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\RolePromotionStat[] $statistics
|
||||
* @property-read Collection|RolePromotionStat[] $statistics
|
||||
*/
|
||||
class RolePromotion extends Model // @phpstan-ignore missingType.iterableValue
|
||||
{
|
||||
@@ -47,7 +48,7 @@ class RolePromotion extends Model // @phpstan-ignore missingType.iterableValue
|
||||
/**
|
||||
* Get the statistics for this promotion
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\RolePromotionStat, $this>
|
||||
* @return HasMany<RolePromotionStat, $this>
|
||||
*/
|
||||
public function statistics(): HasMany
|
||||
{
|
||||
@@ -195,8 +196,8 @@ class RolePromotion extends Model // @phpstan-ignore missingType.iterableValue
|
||||
public function trackApplication(
|
||||
int $userId,
|
||||
int $roleId,
|
||||
?\Illuminate\Support\Carbon $previousExpiryDate = null,
|
||||
?\Illuminate\Support\Carbon $newExpiryDate = null
|
||||
?Carbon $previousExpiryDate = null,
|
||||
?Carbon $newExpiryDate = null
|
||||
): RolePromotionStat {
|
||||
return RolePromotionStat::recordPromotion(
|
||||
$userId,
|
||||
@@ -220,7 +221,7 @@ class RolePromotion extends Model // @phpstan-ignore missingType.iterableValue
|
||||
->get()
|
||||
->groupBy('role_id')
|
||||
->map(function ($stats, $roleId) {
|
||||
/** @var \App\Models\RolePromotionStat|null $firstStat */
|
||||
/** @var RolePromotionStat|null $firstStat */
|
||||
$firstStat = $stats->first();
|
||||
|
||||
return [
|
||||
|
||||
@@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
/**
|
||||
* App\Models\RolePromotionStat
|
||||
@@ -15,14 +17,14 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property int $role_promotion_id
|
||||
* @property int $role_id
|
||||
* @property int $days_added
|
||||
* @property \Carbon\Carbon|null $previous_expiry_date
|
||||
* @property \Carbon\Carbon|null $new_expiry_date
|
||||
* @property \Carbon\Carbon $applied_at
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property-read \App\Models\User $user
|
||||
* @property-read \App\Models\RolePromotion $promotion
|
||||
* @property-read \Spatie\Permission\Models\Role $role
|
||||
* @property Carbon|null $previous_expiry_date
|
||||
* @property Carbon|null $new_expiry_date
|
||||
* @property Carbon $applied_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User $user
|
||||
* @property-read RolePromotion $promotion
|
||||
* @property-read Role $role
|
||||
*/
|
||||
class RolePromotionStat extends Model
|
||||
{
|
||||
@@ -46,7 +48,7 @@ class RolePromotionStat extends Model
|
||||
/**
|
||||
* Get the user that received the promotion
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -56,7 +58,7 @@ class RolePromotionStat extends Model
|
||||
/**
|
||||
* Get the promotion that was applied
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\RolePromotion, $this>
|
||||
* @return BelongsTo<RolePromotion, $this>
|
||||
*/
|
||||
public function promotion(): BelongsTo
|
||||
{
|
||||
@@ -68,7 +70,7 @@ class RolePromotionStat extends Model
|
||||
*/
|
||||
public function role(): BelongsTo // @phpstan-ignore missingType.generics
|
||||
{
|
||||
return $this->belongsTo(\Spatie\Permission\Models\Role::class);
|
||||
return $this->belongsTo(Role::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,8 +155,8 @@ class RolePromotionStat extends Model
|
||||
int $promotionId,
|
||||
int $roleId,
|
||||
int $daysAdded,
|
||||
?\Carbon\Carbon $previousExpiryDate = null,
|
||||
?\Carbon\Carbon $newExpiryDate = null
|
||||
?Carbon $previousExpiryDate = null,
|
||||
?Carbon $newExpiryDate = null
|
||||
): self {
|
||||
return static::create([
|
||||
'user_id' => $userId,
|
||||
|
||||
@@ -4,7 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* App\Models\RootCategory.
|
||||
@@ -13,9 +15,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property string $title
|
||||
* @property int $status
|
||||
* @property int $disablepreview
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Category[] $categories
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Collection|Category[] $categories
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RootCategory newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RootCategory newQuery()
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -19,7 +20,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property string $title Title of the episode.
|
||||
* @property string $firstaired Date of original airing/release.
|
||||
* @property string $summary Description/summary of the episode.
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Release[] $release
|
||||
* @property-read Collection|Release[] $release
|
||||
* @property-read Video $video
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TvEpisode whereEpisode($value)
|
||||
@@ -52,7 +53,7 @@ class TvEpisode extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Video, $this>
|
||||
* @return BelongsTo<Video, $this>
|
||||
*/
|
||||
public function video(): BelongsTo
|
||||
{
|
||||
@@ -60,7 +61,7 @@ class TvEpisode extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function release(): HasMany
|
||||
{
|
||||
|
||||
@@ -7,7 +7,9 @@ namespace App\Models;
|
||||
use App\Services\NNTP\NNTPService;
|
||||
use App\Services\Nzb\NzbService;
|
||||
use App\Services\ReleaseImageService;
|
||||
use App\Services\Releases\ReleaseManagementService;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -28,7 +30,7 @@ use Illuminate\Support\Facades\DB;
|
||||
* @property bool $active
|
||||
* @property bool $backfill
|
||||
* @property string|null $description
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Release[] $release
|
||||
* @property-read Collection|Release[] $release
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UsenetGroup whereActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UsenetGroup whereBackfill($value)
|
||||
@@ -90,7 +92,7 @@ class UsenetGroup extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function release(): HasMany
|
||||
{
|
||||
@@ -387,7 +389,7 @@ class UsenetGroup extends Model
|
||||
|
||||
$releases = $res->get();
|
||||
|
||||
$releaseManagement = app(\App\Services\Releases\ReleaseManagementService::class);
|
||||
$releaseManagement = app(ReleaseManagementService::class);
|
||||
$nzb = app(NzbService::class);
|
||||
$releaseImage = new ReleaseImageService;
|
||||
foreach ($releases as $row) {
|
||||
|
||||
+12
-12
@@ -198,7 +198,7 @@ final class User extends Authenticatable
|
||||
// ===== Relationships =====
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\Spatie\Permission\Models\Role, $this>
|
||||
* @return BelongsTo<Role, $this>
|
||||
*/
|
||||
public function role(): BelongsTo
|
||||
{
|
||||
@@ -206,7 +206,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserRequest, $this>
|
||||
* @return HasMany<UserRequest, $this>
|
||||
*/
|
||||
public function requests(): HasMany
|
||||
{
|
||||
@@ -214,7 +214,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserDownload, $this>
|
||||
* @return HasMany<UserDownload, $this>
|
||||
*/
|
||||
public function downloads(): HasMany
|
||||
{
|
||||
@@ -222,7 +222,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UsersRelease, $this>
|
||||
* @return HasMany<UsersRelease, $this>
|
||||
*/
|
||||
public function releases(): HasMany
|
||||
{
|
||||
@@ -230,7 +230,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserSerie, $this>
|
||||
* @return HasMany<UserSerie, $this>
|
||||
*/
|
||||
public function series(): HasMany
|
||||
{
|
||||
@@ -238,7 +238,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Invitation, $this>
|
||||
* @return HasMany<Invitation, $this>
|
||||
*/
|
||||
public function invitations(): HasMany
|
||||
{
|
||||
@@ -246,7 +246,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\DnzbFailure, $this>
|
||||
* @return HasMany<DnzbFailure, $this>
|
||||
*/
|
||||
public function failedReleases(): HasMany
|
||||
{
|
||||
@@ -254,7 +254,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\ReleaseComment, $this>
|
||||
* @return HasMany<ReleaseComment, $this>
|
||||
*/
|
||||
public function comments(): HasMany
|
||||
{
|
||||
@@ -262,7 +262,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\RolePromotionStat, $this>
|
||||
* @return HasMany<RolePromotionStat, $this>
|
||||
*/
|
||||
public function promotionStats(): HasMany
|
||||
{
|
||||
@@ -270,7 +270,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserRoleHistory, $this>
|
||||
* @return HasMany<UserRoleHistory, $this>
|
||||
*/
|
||||
public function roleHistory(): HasMany
|
||||
{
|
||||
@@ -278,7 +278,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\PasswordSecurity, $this>
|
||||
* @return HasOne<PasswordSecurity, $this>
|
||||
*/
|
||||
public function passwordSecurity(): HasOne
|
||||
{
|
||||
@@ -286,7 +286,7 @@ final class User extends Authenticatable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\UserExcludedCategory, $this>
|
||||
* @return HasMany<UserExcludedCategory, $this>
|
||||
*/
|
||||
public function excludedCategories(): HasMany
|
||||
{
|
||||
|
||||
@@ -4,6 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
@@ -46,7 +49,7 @@ class UserDownload extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -54,7 +57,7 @@ class UserDownload extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
@@ -99,7 +102,7 @@ class UserDownload extends Model
|
||||
->get();
|
||||
|
||||
foreach ($downloads as $download) {
|
||||
$hourKey = \Carbon\Carbon::parse($download->timestamp)->format('H:00');
|
||||
$hourKey = Carbon::parse($download->timestamp)->format('H:00');
|
||||
if (isset($hourlyData[$hourKey])) {
|
||||
$hourlyData[$hourKey]++;
|
||||
}
|
||||
@@ -109,7 +112,7 @@ class UserDownload extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, self>
|
||||
* @return Collection<int, self>
|
||||
*/
|
||||
public static function getDownloadRequestsForUser(mixed $userID)
|
||||
{
|
||||
@@ -120,7 +123,7 @@ class UserDownload extends Model
|
||||
* If a user downloads a NZB, log it.
|
||||
*
|
||||
*
|
||||
* @return int|\Illuminate\Database\Eloquent\Builder
|
||||
* @return int|Builder
|
||||
*/
|
||||
public static function addDownloadRequest(mixed $userID, mixed $releaseID) // @phpstan-ignore missingType.generics
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* App\Models\UserExcludedCategory.
|
||||
@@ -13,10 +14,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property int $id
|
||||
* @property int $users_id
|
||||
* @property int $categories_id
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\Models\User $user
|
||||
* @property-read \App\Models\Category $category
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User $user
|
||||
* @property-read Category $category
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserExcludedCategory whereUsersId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserExcludedCategory whereCategoriesId($value)
|
||||
@@ -41,7 +42,7 @@ class UserExcludedCategory extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -49,7 +50,7 @@ class UserExcludedCategory extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Category, $this>
|
||||
* @return BelongsTo<Category, $this>
|
||||
*/
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
@@ -13,8 +15,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property int $users_id
|
||||
* @property int|null $imdbid
|
||||
* @property string|null $categories List of categories for user movies
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserMovie whereCategories($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserMovie whereCreatedAt($value)
|
||||
@@ -40,7 +42,7 @@ class UserMovie extends Model
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $catID
|
||||
* @return int|\Illuminate\Database\Eloquent\Builder
|
||||
* @return int|Builder
|
||||
*/
|
||||
public static function addMovie(mixed $uid, mixed $imdbid, array $catID = []) // @phpstan-ignore missingType.generics
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -49,7 +50,7 @@ class UserRequest extends Model
|
||||
protected $fillable = ['id', 'users_id', 'request', 'hosthash', 'timestamp'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -109,7 +110,7 @@ class UserRequest extends Model
|
||||
->get();
|
||||
|
||||
foreach ($requests as $request) {
|
||||
$hourKey = \Carbon\Carbon::parse($request->timestamp)->format('H:00');
|
||||
$hourKey = Carbon::parse($request->timestamp)->format('H:00');
|
||||
if (isset($hourlyData[$hourKey])) {
|
||||
$hourlyData[$hourKey]++;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Carbon\CarbonInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
/**
|
||||
* App\Models\UserRoleHistory
|
||||
@@ -21,8 +23,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property bool $is_stacked
|
||||
* @property string|null $change_reason
|
||||
* @property int|null $changed_by
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User $user
|
||||
* @property-read User|null $changedByUser
|
||||
*/
|
||||
@@ -52,7 +54,7 @@ class UserRoleHistory extends Model
|
||||
/**
|
||||
* Get the user this history belongs to
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -62,7 +64,7 @@ class UserRoleHistory extends Model
|
||||
/**
|
||||
* Get the admin who made this change
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function changedByUser(): BelongsTo
|
||||
{
|
||||
@@ -74,7 +76,7 @@ class UserRoleHistory extends Model
|
||||
*/
|
||||
public function oldRole(): BelongsTo // @phpstan-ignore missingType.generics
|
||||
{
|
||||
return $this->belongsTo(\Spatie\Permission\Models\Role::class, 'old_role_id');
|
||||
return $this->belongsTo(Role::class, 'old_role_id');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +84,7 @@ class UserRoleHistory extends Model
|
||||
*/
|
||||
public function newRole(): BelongsTo // @phpstan-ignore missingType.generics
|
||||
{
|
||||
return $this->belongsTo(\Spatie\Permission\Models\Role::class, 'new_role_id');
|
||||
return $this->belongsTo(Role::class, 'new_role_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
@@ -14,8 +16,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property int $users_id
|
||||
* @property int $videos_id FK to videos.id
|
||||
* @property string|null $categories List of categories for user tv shows
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read User $user
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserSerie whereCategories($value)
|
||||
@@ -41,7 +43,7 @@ class UserSerie extends Model
|
||||
protected $dateFormat = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -53,7 +55,7 @@ class UserSerie extends Model
|
||||
*
|
||||
*
|
||||
* @param array<string, mixed> $catID
|
||||
* @return int|\Illuminate\Database\Eloquent\Builder
|
||||
* @return int|Builder
|
||||
*/
|
||||
public static function addShow(mixed $userId, mixed $videoId, array $catID = []) // @phpstan-ignore missingType.generics
|
||||
{
|
||||
|
||||
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
@@ -13,8 +15,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
* @property int $id
|
||||
* @property int $users_id
|
||||
* @property int $releases_id FK to releases.id
|
||||
* @property \Carbon\Carbon|null $created_at
|
||||
* @property \Carbon\Carbon|null $updated_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property-read Release $release
|
||||
* @property-read User $user
|
||||
*
|
||||
@@ -40,7 +42,7 @@ class UsersRelease extends Model
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
@@ -48,7 +50,7 @@ class UsersRelease extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Release, $this>
|
||||
* @return BelongsTo<Release, $this>
|
||||
*/
|
||||
public function release(): BelongsTo
|
||||
{
|
||||
@@ -61,7 +63,7 @@ class UsersRelease extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|\Illuminate\Database\Eloquent\Builder
|
||||
* @return int|Builder
|
||||
*/
|
||||
public static function addCart(mixed $uid, mixed $releaseid) // @phpstan-ignore missingType.generics
|
||||
{
|
||||
|
||||
+10
-8
@@ -5,9 +5,11 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* App\Models\Video.
|
||||
@@ -25,9 +27,9 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
* @property int $tvmaze ID number for TVMaze site.
|
||||
* @property int $tvrage ID number for TVRage site.
|
||||
* @property bool $source Which site did we use for info?
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\VideoAlias[] $alias
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TvEpisode[] $episode
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Release[] $release
|
||||
* @property-read Collection|VideoAlias[] $alias
|
||||
* @property-read Collection|TvEpisode[] $episode
|
||||
* @property-read Collection|Release[] $release
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Video whereAnidb($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Video whereCountriesId($value)
|
||||
@@ -64,7 +66,7 @@ class Video extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\VideoAlias, $this>
|
||||
* @return HasMany<VideoAlias, $this>
|
||||
*/
|
||||
public function alias(): HasMany
|
||||
{
|
||||
@@ -72,7 +74,7 @@ class Video extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Release, $this>
|
||||
* @return HasMany<Release, $this>
|
||||
*/
|
||||
public function release(): HasMany
|
||||
{
|
||||
@@ -80,7 +82,7 @@ class Video extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\TvEpisode, $this>
|
||||
* @return HasMany<TvEpisode, $this>
|
||||
*/
|
||||
public function episode(): HasMany
|
||||
{
|
||||
@@ -88,7 +90,7 @@ class Video extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<\App\Models\TvInfo, $this>
|
||||
* @return HasOne<TvInfo, $this>
|
||||
*/
|
||||
public function tvInfo(): HasOne
|
||||
{
|
||||
@@ -203,7 +205,7 @@ class Video extends Model
|
||||
ORDER BY videos.title ASC
|
||||
";
|
||||
|
||||
$results = \Illuminate\Support\Facades\DB::select($sql, $params);
|
||||
$results = DB::select($sql, $params);
|
||||
|
||||
// Convert stdClass objects to arrays for backward compatibility
|
||||
return array_map(fn ($row) => (array) $row, $results);
|
||||
|
||||
@@ -38,7 +38,7 @@ class VideoAlias extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Video, $this>
|
||||
* @return BelongsTo<Video, $this>
|
||||
*/
|
||||
public function video(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace App\Observers;
|
||||
use App\Jobs\SendAccountChangedEmail;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivity;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
class UserActivityObserver
|
||||
{
|
||||
@@ -162,7 +163,7 @@ class UserActivityObserver
|
||||
}
|
||||
|
||||
try {
|
||||
$role = \Spatie\Permission\Models\Role::find($roleId);
|
||||
$role = Role::find($roleId);
|
||||
|
||||
return $role ? $role->name : "Role #{$roleId}";
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Jobs\SendWelcomeEmail;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
use Jrean\UserVerification\Exceptions\ModelNotCompliantException;
|
||||
use Jrean\UserVerification\Facades\UserVerification;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
@@ -18,7 +19,7 @@ class UserServiceObserver
|
||||
* Handle the user "created" event.
|
||||
*
|
||||
*
|
||||
* @throws \Jrean\UserVerification\Exceptions\ModelNotCompliantException
|
||||
* @throws ModelNotCompliantException
|
||||
*/
|
||||
public function created(User $user): void
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ use App\Observers\MovieInfoObserver;
|
||||
use App\Observers\ReleaseObserver;
|
||||
use App\Observers\RolePromotionObserver;
|
||||
use App\Observers\VideoObserver;
|
||||
use App\View\Composers\GlobalDataComposer;
|
||||
use Illuminate\Auth\Events\Login;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
@@ -38,7 +39,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
'layouts.guest',
|
||||
'layouts.app',
|
||||
'admin.*',
|
||||
], \App\View\Composers\GlobalDataComposer::class);
|
||||
], GlobalDataComposer::class);
|
||||
|
||||
Gate::define('viewPulse', function (User $user) {
|
||||
return $user->hasRole('Admin');
|
||||
|
||||
@@ -20,6 +20,7 @@ use FFMpeg\FFProbe;
|
||||
use FFMpeg\Filters\Video\ResizeFilter;
|
||||
use FFMpeg\Format\Audio\Vorbis;
|
||||
use FFMpeg\Format\Video\Ogg;
|
||||
use FFMpeg\Media\Video;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Mhor\MediaInfo\MediaInfo;
|
||||
@@ -89,7 +90,7 @@ class MediaExtractionService
|
||||
|
||||
try {
|
||||
if ($this->ffprobe()->isValid($fileLocation)) {
|
||||
/** @var \FFMpeg\Media\Video $video */
|
||||
/** @var Video $video */
|
||||
$video = $this->ffmpeg()->open($fileLocation);
|
||||
$video->frame(TimeCode::fromString($time === '' ? '00:00:03:00' : $time))
|
||||
->save($fileName);
|
||||
@@ -150,7 +151,7 @@ class MediaExtractionService
|
||||
|
||||
try {
|
||||
if ($this->ffprobe()->isValid($fileLocation)) {
|
||||
/** @var \FFMpeg\Media\Video $video */
|
||||
/** @var Video $video */
|
||||
$video = $this->ffmpeg()->open($fileLocation);
|
||||
$clip = $video->clip(
|
||||
TimeCode::fromString($lowestLength),
|
||||
@@ -173,7 +174,7 @@ class MediaExtractionService
|
||||
if (! $newMethod) {
|
||||
try {
|
||||
if ($this->ffprobe()->isValid($fileLocation)) {
|
||||
/** @var \FFMpeg\Media\Video $video */
|
||||
/** @var Video $video */
|
||||
$video = $this->ffmpeg()->open($fileLocation);
|
||||
$clip = $video->clip(
|
||||
TimeCode::fromSeconds(0),
|
||||
|
||||
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Services\AdditionalProcessing;
|
||||
|
||||
use App\Facades\Search;
|
||||
use App\Models\Category;
|
||||
use App\Models\MediaInfo as MediaInfoModel;
|
||||
use App\Models\Predb;
|
||||
use App\Models\Release;
|
||||
@@ -17,6 +19,7 @@ use App\Services\NNTP\NNTPService;
|
||||
use App\Services\Nzb\NzbService;
|
||||
use App\Services\ReleaseImageService;
|
||||
use App\Services\Releases\ReleaseBrowseService;
|
||||
use dariusiii\rarinfo\Par2Info;
|
||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\File;
|
||||
@@ -146,7 +149,7 @@ class ReleaseFileManager
|
||||
*/
|
||||
public function updateSearchIndex(int $releaseId): void
|
||||
{
|
||||
\App\Facades\Search::updateRelease($releaseId);
|
||||
Search::updateRelease($releaseId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,7 +278,7 @@ class ReleaseFileManager
|
||||
|
||||
// Delete from search index
|
||||
try {
|
||||
\App\Facades\Search::deleteRelease($id);
|
||||
Search::deleteRelease($id);
|
||||
} catch (\Throwable) {
|
||||
// Ignore
|
||||
}
|
||||
@@ -296,7 +299,7 @@ class ReleaseFileManager
|
||||
public function processPar2File(
|
||||
string $fileLocation,
|
||||
ReleaseProcessingContext $context,
|
||||
\dariusiii\rarinfo\Par2Info $par2Info
|
||||
Par2Info $par2Info
|
||||
): bool {
|
||||
$par2Info->open($fileLocation);
|
||||
|
||||
@@ -318,7 +321,7 @@ class ReleaseFileManager
|
||||
// Only get new name if category is OTHER
|
||||
$foundName = true;
|
||||
if ((int) $releaseInfo->proc_pp === 0 && $this->config->renamePar2
|
||||
&& in_array((int) $context->release->categories_id, \App\Models\Category::OTHERS_GROUP, false)
|
||||
&& in_array((int) $context->release->categories_id, Category::OTHERS_GROUP, false)
|
||||
) {
|
||||
$foundName = false;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ final class BackfillService
|
||||
/**
|
||||
* Log backfill completion.
|
||||
*/
|
||||
private function logBackfillComplete(\Illuminate\Support\Carbon $startTime): void
|
||||
private function logBackfillComplete(Carbon $startTime): void
|
||||
{
|
||||
$duration = now()->diffInSeconds($startTime, true);
|
||||
$this->log("Backfilling completed in {$duration} seconds.");
|
||||
@@ -385,7 +385,7 @@ final class BackfillService
|
||||
/**
|
||||
* Log group completion.
|
||||
*/
|
||||
private function logGroupComplete(string $shortGroupName, \Illuminate\Support\Carbon $startTime): void
|
||||
private function logGroupComplete(string $shortGroupName, Carbon $startTime): void
|
||||
{
|
||||
$duration = number_format(now()->timestamp - $startTime->timestamp, 2);
|
||||
$this->log(PHP_EOL."Group {$shortGroupName} processed in {$duration} seconds.");
|
||||
|
||||
@@ -8,6 +8,7 @@ use App\Models\BookInfo;
|
||||
use App\Models\Category;
|
||||
use App\Models\Release;
|
||||
use App\Models\Settings;
|
||||
use App\Services\Releases\ReleaseBrowseService;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -114,7 +115,7 @@ class BookService
|
||||
}
|
||||
$order = $this->getBookOrder($orderBy);
|
||||
$expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium'));
|
||||
$showPasswords = app(\App\Services\Releases\ReleaseBrowseService::class)->showPasswords();
|
||||
$showPasswords = app(ReleaseBrowseService::class)->showPasswords();
|
||||
|
||||
$baseWhere = "boo.cover = 1 AND boo.title != '' "
|
||||
."AND r.passwordstatus {$showPasswords} "
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace App\Services\Categorization;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Services\Categorization\Pipes\AbstractCategorizationPipe;
|
||||
use Blacklight\Categorize;
|
||||
|
||||
/**
|
||||
* Categorization service using Laravel Pipeline.
|
||||
@@ -106,9 +107,9 @@ class CategorizationService
|
||||
$legacyCategoryId = Category::OTHER_MISC;
|
||||
$legacyCategoryName = 'Unknown';
|
||||
|
||||
if (class_exists(\Blacklight\Categorize::class)) {
|
||||
if (class_exists(Categorize::class)) {
|
||||
try {
|
||||
$legacy = new \Blacklight\Categorize;
|
||||
$legacy = new Categorize;
|
||||
/** @var int $legacyCategoryId */
|
||||
$legacyCategoryId = (int) $legacy->determineCategory($groupId, $releaseName);
|
||||
$legacyCategory = Category::find($legacyCategoryId);
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\GamesInfo;
|
||||
use App\Models\Genre;
|
||||
use App\Models\Release;
|
||||
use App\Models\Settings;
|
||||
use App\Services\Releases\ReleaseBrowseService;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -201,7 +202,7 @@ class GamesService
|
||||
}
|
||||
$order = $this->getGamesOrder($orderBy);
|
||||
$expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium'));
|
||||
$showPasswords = app(\App\Services\Releases\ReleaseBrowseService::class)->showPasswords();
|
||||
$showPasswords = app(ReleaseBrowseService::class)->showPasswords();
|
||||
|
||||
$baseWhere = "gi.title != '' AND gi.cover = 1 "
|
||||
."AND r.passwordstatus {$showPasswords} "
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user