Skip to content

Commit

Permalink
Remove unused files and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Dec 22, 2023
1 parent 0817de8 commit 18a0496
Show file tree
Hide file tree
Showing 231 changed files with 7,985 additions and 5,562 deletions.
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ stages:

variables:
NODE_VERSION: 18.17.0
PHP_VERSION: '8.2'
PHP_VERSION: "8.2"

deploy-job:
stage: deploy
image: alpine:latest
before_script:
- 'command -v ssh-agent >/dev/null || ( apk add --update openssh )'
- "command -v ssh-agent >/dev/null || ( apk add --update openssh )"
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SSH_IP >> ~/.ssh/known_hosts
- ssh-keyscan -p $SSH_PORT $SSH_IP >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh $SSH_USER@$SSH_IP "
- ssh -p $SSH_PORT $SSH_USER@$SSH_IP "
. ~/.zshrc &&
cd /home/$SSH_USER/www/$CI_PROJECT_NAME &&
git pull &&
Expand All @@ -36,6 +36,6 @@ deploy-job:
/home/$SSH_USER/.nvm/versions/node/v$NODE_VERSION/bin/pnpm i &&
/home/$SSH_USER/.nvm/versions/node/v$NODE_VERSION/bin/pnpm build &&
supervisorctl start bookshelves-worker:bookshelves-worker_00 &&
notifier '$CI_PROJECT_TITLE'"
notifier discord '$CI_PROJECT_TITLE'"
only:
- main
110 changes: 0 additions & 110 deletions .phpstorm.meta.php

Large diffs are not rendered by default.

File renamed without changes.
33 changes: 33 additions & 0 deletions .vscode/archive/resources/views/app.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
<meta charset="utf-8">
<meta
name="viewport"
content="width=device-width, initial-scale=1"
>

<title inertia>{{ config('app.name', 'Laravel') }}</title>

<!-- Fonts -->
<link
href="https://fonts.bunny.net"
rel="preconnect"
>
<link
href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap"
rel="stylesheet"
/>

<!-- Scripts -->
@routes
@vite(['resources/js/app.ts', "resources/js/Pages/{$page['component']}.vue"])
@inertiaHead
</head>

<body class="font-sans antialiased">
@inertia
</body>

</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **Bookshelves** <!-- omit in toc -->
# **Bookshelves**

![banner](https://raw.githubusercontent.com/bookshelves-project/bookshelves/main/public/vendor/images/banner-github.png)

Expand Down
1 change: 1 addition & 0 deletions _ide_helper_models.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ class TagExtend extends \Eloquent {}
* @property-read int|null $media_count
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
* @property-read int|null $notifications_count
* @property-read string $profile_photo_url
* @property-read \Illuminate\Database\Eloquent\Collection<int, \Laravel\Sanctum\PersonalAccessToken> $tokens
* @property-read int|null $tokens_count
* @method static \Database\Factories\UserFactory factory($count = null, $state = [])
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Commands/Bookshelves/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ private function setupOptions()
$this->files = $parser->items();

if ($this->fresh) {
MediaExtended::where('collection_name', MediaDiskEnum::cover)->delete();
MediaExtended::query()->where('collection_name', MediaDiskEnum::cover)->delete();

foreach (BookFormatEnum::toArray() as $format) {
MediaExtended::where('collection_name', $format)->delete();
MediaExtended::query()->where('collection_name', $format)->delete();
}
File::deleteDirectory(public_path('storage/media/covers'));
File::deleteDirectory(public_path('storage/media/formats'));
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Rad/RadGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function toArray(): array
/**
* Generate new file from `stubs` for new model.
*/
protected function generateFromStub(string $name, string $destination_path, string $extension, string $stub_path = null, ?bool $createDir = false): bool
protected function generateFromStub(string $name, string $destination_path, string $extension, ?string $stub_path = null, ?bool $createDir = false): bool
{
$destination = "{$destination_path}/{$name}.{$extension}";
$type = str_replace($this->model, '', $name);
Expand Down
2 changes: 1 addition & 1 deletion app/Engines/Book/BookFilesReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function __construct(
/**
* Get all files from `storage/data/books`.
*/
public static function make(int $limit = null): self
public static function make(?int $limit = null): self
{
$path = config('bookshelves.directory');

Expand Down
2 changes: 1 addition & 1 deletion app/Engines/Book/Converter/BookConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function __construct(
/**
* Set Book from Ebook.
*/
public static function make(Ebook $ebook, BookTypeEnum $type, Book $book = null): self
public static function make(Ebook $ebook, BookTypeEnum $type, ?Book $book = null): self
{
$self = new self($ebook);
$self->parse($type, $book);
Expand Down
5 changes: 2 additions & 3 deletions app/Engines/SearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use ReflectionClass;
use Str;

/**
* Search Engine with laravel/scout
Expand Down Expand Up @@ -52,7 +52,7 @@ public function __construct(
/**
* Create an instance of SearchEngine from query.
*/
public static function make(?string $q = '', bool $relevant = false, bool $opds = false, string|array $types = null): self
public static function make(?string $q = '', bool $relevant = false, bool $opds = false, string|array|null $types = null): self
{
if (gettype($types) === 'string') {
$types = explode(',', $types);
Expand Down Expand Up @@ -163,7 +163,6 @@ private function entitySearch(string $model, array $relations)
{
$instance = new $model();
$class = new ReflectionClass($instance);
$static = $class->getName();
$name = $class->getShortName();
$key = Str::plural($name);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?php

namespace App\Filament\Resources\Books;
namespace App\Filament\Resources;

use App\Enums\AuthorRoleEnum;
use App\Filament\RelationManagers\BooksRelationManager;
use App\Filament\RelationManagers\ReviewsRelationManager;
use App\Filament\RelationManagers\SeriesRelationManager;
use App\Filament\Resources\Books\AuthorResource\Pages;
use App\Filament\Resources\AuthorResource\Pages;
use App\Models\Author;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Kiwilan\Steward\Filament\Config\FilamentLayout;
use Kiwilan\Steward\Filament\Table\Actions\EditActionRounded;

class AuthorResource extends Resource
{
Expand Down Expand Up @@ -81,6 +82,10 @@ public static function table(Table $table): Table
Tables\Columns\TextColumn::make('firstname')
->label('Firstname')
->sortable(),
Tables\Columns\TextColumn::make('description')
->label('Description')
->limit(50)
->sortable(),
Tables\Columns\TextColumn::make('slug')
->label('Metalink')
->searchable()
Expand All @@ -107,7 +112,7 @@ public static function table(Table $table): Table
//
])
->actions([
Tables\Actions\EditAction::make(),
EditActionRounded::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\AuthorResource\Pages;
namespace App\Filament\Resources\AuthorResource\Pages;

use App\Filament\Resources\Books\AuthorResource;
use App\Filament\Resources\AuthorResource;
use Filament\Resources\Pages\CreateRecord;

class CreateAuthor extends CreateRecord
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\AuthorResource\Pages;
namespace App\Filament\Resources\AuthorResource\Pages;

use App\Filament\Resources\Books\AuthorResource;
use App\Filament\Resources\AuthorResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\AuthorResource\Pages;
namespace App\Filament\Resources\AuthorResource\Pages;

use App\Filament\Resources\Books\AuthorResource;
use App\Filament\Resources\AuthorResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace App\Filament\Resources\Books;
namespace App\Filament\Resources;

use App\Enums\BookFormatEnum;
use App\Enums\BookTypeEnum;
use App\Filament\Resources\Books\BookResource\Pages;
use App\Filament\Resources\BookResource\Pages;
use App\Models\Book;
use Filament\Forms;
use Filament\Forms\Form;
Expand All @@ -15,6 +15,7 @@
use Kiwilan\Steward\Filament\Components\MetaBlock;
use Kiwilan\Steward\Filament\Config\FilamentLayout;
use Kiwilan\Steward\Filament\Filters\DateFilter;
use Kiwilan\Steward\Filament\Table\Actions\EditActionRounded;

class BookResource extends Resource
{
Expand Down Expand Up @@ -220,7 +221,7 @@ public static function table(Table $table): Table
->options(BookTypeEnum::toList()),
])
->actions([
Tables\Actions\EditAction::make(),
EditActionRounded::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\BookResource\Pages;
namespace App\Filament\Resources\BookResource\Pages;

use App\Filament\Resources\Books\BookResource;
use App\Filament\Resources\BookResource;
use Filament\Resources\Pages\CreateRecord;

class CreateBook extends CreateRecord
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\BookResource\Pages;
namespace App\Filament\Resources\BookResource\Pages;

use App\Filament\Resources\Books\BookResource;
use App\Filament\Resources\BookResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\BookResource\Pages;
namespace App\Filament\Resources\BookResource\Pages;

use App\Filament\Resources\Books\BookResource;
use App\Filament\Resources\BookResource;
use App\Jobs\SyncBooks;
use Filament\Actions;
use Filament\Notifications\Notification;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace App\Filament\Resources\Books;
namespace App\Filament\Resources;

use App\Enums\BookTypeEnum;
use App\Filament\RelationManagers\BooksRelationManager;
use App\Filament\Resources\Books\SerieResource\Pages;
use App\Filament\Resources\SerieResource\Pages;
use App\Models\Serie;
use Filament\Forms;
use Filament\Forms\Form;
Expand All @@ -14,6 +14,7 @@
use Filament\Tables\Table;
use Kiwilan\Steward\Filament\Components\MetaBlock;
use Kiwilan\Steward\Filament\Config\FilamentLayout;
use Kiwilan\Steward\Filament\Table\Actions\EditActionRounded;

class SerieResource extends Resource
{
Expand Down Expand Up @@ -134,7 +135,7 @@ public static function table(Table $table): Table
//
])
->actions([
Tables\Actions\EditAction::make(),
EditActionRounded::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\SerieResource\Pages;
namespace App\Filament\Resources\SerieResource\Pages;

use App\Filament\Resources\Books\SerieResource;
use App\Filament\Resources\SerieResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\SerieResource\Pages;
namespace App\Filament\Resources\SerieResource\Pages;

use App\Filament\Resources\Books\SerieResource;
use App\Filament\Resources\SerieResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace App\Filament\Resources\Books\SerieResource\Pages;
namespace App\Filament\Resources\SerieResource\Pages;

use App\Filament\Resources\Books\SerieResource;
use App\Filament\Resources\SerieResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function direct(Request $request, Author $author, Book $book)
* @header Content-Type application/octet-stream
*/
#[Get('/author/{author_slug}/{format?}', 'api.download.author')]
public function author(Author $author, string $format = null)
public function author(Author $author, ?string $format = null)
{
$files = [];

Expand Down Expand Up @@ -109,7 +109,7 @@ public function author(Author $author, string $format = null)
* @header Content-Type application/octet-stream
*/
#[Get('/serie/{author_slug}/{serie_slug}/{format?}', 'api.download.serie')]
public function serie(Author $author, Serie $serie, string $format = null)
public function serie(Author $author, Serie $serie, ?string $format = null)
{
$files = [];

Expand Down Expand Up @@ -137,7 +137,7 @@ public function serie(Author $author, Serie $serie, string $format = null)
return MediaStream::create("{$dirname}.zip")->addMedia($files);
}

private static function getFormat(Book $book, string $format = null): ?string
private static function getFormat(Book $book, ?string $format = null): ?string
{
if ($format !== null) {
$format = BookFormatEnum::tryFrom($format)->name;
Expand Down
20 changes: 20 additions & 0 deletions app/Http/Controllers/Front/BookController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Http\Controllers\Front;

use App\Http\Controllers\Controller;
use App\Utils\FrontNavigation;
use Spatie\RouteAttributes\Attributes\Get;

class BookController extends Controller
{
#[Get('/books', name: 'front.books.index')]
public function index()
{
// $developer = FrontNavigation::getDeveloperNavigation();

return inertia('Books/Index', [
// 'developer' => $developer,
]);
}
}
Loading

0 comments on commit 18a0496

Please sign in to comment.