Skip to content

A self-hosted media server and file management system

fix image url form

aminnausind03e171c7fe0
diff --git a/app/Http/Requests/MetadataStoreRequest.php b/app/Http/Requests/MetadataStoreRequest.php
index d564d2ce..c9668ffb 100644
--- a/app/Http/Requests/MetadataStoreRequest.php
+++ b/app/Http/Requests/MetadataStoreRequest.php
@@ -13,10 +13,12 @@ class MetadataStoreRequest extends FormRequest {
return Auth::check();
}
- /** * Prepare the data for validation. */
+ /**
+ * Prepare the data for validation.
+ */
protected function prepareForValidation() {
if ($this->has('poster_url')) {
- $this->merge(['poster_url' => urlencode($this->input('poster_url'))]);
+ $this->merge(['poster_url' => str_replace(' ', '%20', $this->input('poster_url'))]);
}
}
@@ -31,7 +33,7 @@ class MetadataStoreRequest extends FormRequest {
'title' => 'required|max:255',
'description' => 'nullable',
'episode' => 'nullable|integer|min:0',
- 'season' => 'nullable|integer|min:1',
+ 'season' => 'nullable|integer|min:0',
'poster_url' => 'nullable|url',
'date_released' => 'nullable|date|date_format:"F d, Y"',
'tags' => 'nullable|max:128',
diff --git a/app/Http/Requests/MetadataUpdateRequest.php b/app/Http/Requests/MetadataUpdateRequest.php
index 0ea3f0cc..c6c79cd2 100644
--- a/app/Http/Requests/MetadataUpdateRequest.php
+++ b/app/Http/Requests/MetadataUpdateRequest.php
@@ -13,10 +13,12 @@ class MetadataUpdateRequest extends FormRequest {
return Auth::check();
}
- /** * Prepare the data for validation. */
+ /**
+ * Prepare the data for validation.
+ */
protected function prepareForValidation() {
if ($this->has('poster_url')) {
- $this->merge(['poster_url' => urlencode($this->input('poster_url'))]);
+ $this->merge(['poster_url' => str_replace(' ', '%20', $this->input('poster_url'))]);
}
}
@@ -30,7 +32,7 @@ class MetadataUpdateRequest extends FormRequest {
'title' => 'required|max:255',
'description' => 'nullable',
'episode' => 'nullable|integer|min:0',
- 'season' => 'nullable|integer|min:1',
+ 'season' => 'nullable|integer|min:0',
'poster_url' => 'nullable|url',
'date_released' => 'nullable|date|date_format:"F d, Y"',
'tags' => 'nullable|max:128',
diff --git a/app/Http/Requests/SeriesStoreRequest.php b/app/Http/Requests/SeriesStoreRequest.php
index 6fc61cb1..ce7a3c43 100644
--- a/app/Http/Requests/SeriesStoreRequest.php
+++ b/app/Http/Requests/SeriesStoreRequest.php
@@ -13,10 +13,12 @@ class SeriesStoreRequest extends FormRequest {
return Auth::check();
}
- /** * Prepare the data for validation. */
+ /**
+ * Prepare the data for validation.
+ */
protected function prepareForValidation() {
if ($this->has('thumbnail_url')) {
- $this->merge(['thumbnail_url' => urlencode($this->input('thumbnail_url'))]);
+ $this->merge(['thumbnail_url' => str_replace(' ', '%20', $this->input('thumbnail_url'))]);
}
}
@@ -32,7 +34,7 @@ class SeriesStoreRequest extends FormRequest {
'description' => 'nullable',
'studio' => 'nullable|max:255',
'rating' => 'nullable|integer|min:0|max:100',
- 'seasons' => 'nullable|integer|min:1',
+ 'seasons' => 'nullable|integer|min:0',
'episodes' => 'nullable|integer|min:0',
'films' => 'nullable|integer|min:0',
'date_start' => 'nullable|date|date_format:"F d, Y"',
diff --git a/app/Http/Requests/SeriesUpdateRequest.php b/app/Http/Requests/SeriesUpdateRequest.php
index 3209c166..bdc875f0 100644
--- a/app/Http/Requests/SeriesUpdateRequest.php
+++ b/app/Http/Requests/SeriesUpdateRequest.php
@@ -13,10 +13,12 @@ class SeriesUpdateRequest extends FormRequest {
return Auth::check();
}
- /** * Prepare the data for validation. */
+ /**
+ * Prepare the data for validation.
+ */
protected function prepareForValidation() {
if ($this->has('thumbnail_url')) {
- $this->merge(['thumbnail_url' => urlencode($this->input('thumbnail_url'))]);
+ $this->merge(['thumbnail_url' => str_replace(' ', '%20', $this->input('thumbnail_url'))]);
}
}
@@ -31,7 +33,7 @@ class SeriesUpdateRequest extends FormRequest {
'description' => 'nullable',
'studio' => 'nullable|max:255',
'rating' => 'nullable|integer|min:0|max:100',
- 'seasons' => 'nullable|integer|min:1',
+ 'seasons' => 'nullable|integer|min:0',
'episodes' => 'nullable|integer|min:0',
'films' => 'nullable|integer|min:0',
'date_start' => 'nullable|date|date_format:"F d, Y"',