From 5ffb783b44ecc53891b941bd6711bdbbe21e796d Mon Sep 17 00:00:00 2001 From: Roardom Date: Wed, 26 Mar 2025 03:10:05 +0000 Subject: [PATCH] fix: search by tmdb 0 to find missing tmdbs Not sure what was going through my mind when deciding the query for this the first time around, it didn't exactly do anything useful. Now it's back to doing what it used to do before the switch to nulls instead of 0s for metadata ids: finding torrents without any associated tmdb. --- app/DTO/TorrentSearchFiltersDTO.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/DTO/TorrentSearchFiltersDTO.php b/app/DTO/TorrentSearchFiltersDTO.php index e8c20e1ea9..d311f519a6 100644 --- a/app/DTO/TorrentSearchFiltersDTO.php +++ b/app/DTO/TorrentSearchFiltersDTO.php @@ -536,10 +536,12 @@ final public function toMeilisearchFilter(): array if ($this->tmdbId !== null) { if ($this->tmdbId === 0) { $filters[] = [ - 'tmdb_movie_id IS NULL AND tmdb_tv_id IS NOT NULL', - 'tmdb_tv_id IS NULL AND tmdb_movie_id IS NOT NULL', - 'tmdb_movie_id = 0 AND tmdb_tv_id != 0', - 'tmdb_tv_id = 0 AND tmdb_movie_id != 0', + 'tmdb_movie_id IS NULL', + 'tmdb_movie_id = 0', + ]; + $filters[] = [ + 'tmdb_tv_id IS NULL', + 'tmdb_tv_id = 0', ]; } else { $filters[] = [