Merge pull request #4852 from Roardom/fix-imdb-regex

This commit is contained in:
HDVinnie
2025-07-19 08:14:20 -04:00
committed by GitHub
5 changed files with 5 additions and 4 deletions
@@ -59,7 +59,7 @@ class QuickSearchController extends Controller
$searchById = true;
}
if (preg_match('/tt0*(?=(\d{7,}))/', $query, $matches)) {
if (preg_match('/tt0*(\d{7,})/', $query, $matches)) {
$filters[] = 'imdb = '.$matches[1];
$searchById = true;
}
+1 -1
View File
@@ -242,7 +242,7 @@ class TorrentRequestSearch extends Component
->when($this->typeIds !== [], fn ($query) => $query->whereIntegerInRaw('type_id', $this->typeIds))
->when($this->resolutionIds !== [], fn ($query) => $query->whereIntegerInRaw('resolution_id', $this->resolutionIds))
->when($this->tmdbId !== null, fn ($query) => $query->where(fn ($query) => $query->where('tmdb_movie_id', '=', $this->tmdbId)->orWhere('tmdb_tv_id', '=', $this->tmdbId)))
->when($this->imdbId !== '', fn ($query) => $query->where('imdb', '=', (preg_match('/tt0*(?=(\d{7,}))/', $this->imdbId, $matches) ? $matches[1] : $this->imdbId)))
->when($this->imdbId !== '', fn ($query) => $query->where('imdb', '=', (preg_match('/tt0*(\d{7,})/', $this->imdbId, $matches) ? $matches[1] : $this->imdbId)))
->when($this->tvdbId !== null, fn ($query) => $query->where('tvdb', '=', $this->tvdbId))
->when($this->malId !== null, fn ($query) => $query->where('mal', '=', $this->malId))
->when(
+1 -1
View File
@@ -375,7 +375,7 @@ class TorrentSearch extends Component
default => null,
},
tmdbId: $this->tmdbId,
imdbId: $this->imdbId === '' ? null : ((int) (preg_match('/tt0*(?=(\d{7,}))/', $this->imdbId, $matches) ? $matches[1] : $this->imdbId)),
imdbId: $this->imdbId === '' ? null : ((int) (preg_match('/tt0*(\d{7,})/', $this->imdbId, $matches) ? $matches[1] : $this->imdbId)),
tvdbId: $this->tvdbId,
malId: $this->malId,
playlistId: $this->playlistId,
@@ -53,6 +53,7 @@
class="form__text"
type="search"
autocomplete="off"
pattern="[0-9]+|tt0*\d{7,}"
placeholder=" "
/>
<label class="form__label form__label--floating" for="imdbId">IMDb ID</label>
@@ -298,7 +298,7 @@
wire:model.live="imdbId"
class="form__text"
inputmode="numeric"
pattern="[0-9]*"
pattern="[0-9]+|tt0*\d{7,}"
placeholder=" "
/>
<label class="form__label form__label--floating" for="imdbId">IMDb ID</label>