From 0faedab3d803360b6844857757a1af47046eb633 Mon Sep 17 00:00:00 2001 From: Mythos Date: Sat, 5 Feb 2022 16:10:28 +0100 Subject: [PATCH] Apply fix for update button --- CHANGELOG.md | 4 ++++ app/Http/Livewire/Series/ShowSeries.php | 7 +++++-- config/app.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e201a8ee..b3548b66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.0.3 (2022-02-05) + +- Applied fixes from 2.0.2 to update button + ## 2.0.2 (2022-02-05) - Fix volume creation when number is not set diff --git a/app/Http/Livewire/Series/ShowSeries.php b/app/Http/Livewire/Series/ShowSeries.php index 3a1313a6..1b26db77 100644 --- a/app/Http/Livewire/Series/ShowSeries.php +++ b/app/Http/Livewire/Series/ShowSeries.php @@ -143,7 +143,10 @@ public function update():void $this->series->status = 0; } } - if (!empty($result['sources'])) { + + if (!empty($result['status']) && $result['status'] == 2) { + $this->series->total = $result['numVolumes']; + } elseif (!empty($result['sources'])) { $sourceId = $result['sources'][0]['id']; $sourceResponse = Http::get('https://api.manga-passion.de/sources/' . $sourceId); if ($sourceResponse->successful()) { @@ -198,7 +201,7 @@ private function createVolumes(): void $volume = new Volume([ 'series_id' => $this->series->id, 'isbn' => Isbn::of($volumeResult['isbn13'])->to13(), - 'number' => $volumeResult['number'], + 'number' => $volumeResult['number'] ?? 1, 'publish_date' => !empty($publish_date) ? $publish_date->format('Y-m-d') : null, 'price' => !empty($volumeResult['price']) ? floatval($volumeResult['price']) / 100.0 : 0, 'status' => $this->series->subscription_active, diff --git a/config/app.php b/config/app.php index 6cd48f0f..259a2abe 100644 --- a/config/app.php +++ b/config/app.php @@ -10,7 +10,7 @@ | Current application version. | */ - 'version' => env('APP_VERSION', '2.0.2'), + 'version' => env('APP_VERSION', '2.0.3'), /* |--------------------------------------------------------------------------