@@ -200,12 +200,12 @@ final public function toSqlQueryBuilder(): Closure
200
200
->where (
201
201
fn ($ query ) => $ query
202
202
->whereRelation ('category ' , 'movie_meta ' , '= ' , true )
203
- ->whereIn ('movie_id ' , DB ::table ('genre_movie ' )->select ('movie_id ' )->whereIn ('genre_id ' , $ this ->genreIds ))
203
+ ->whereIn ('tmdb_movie_id ' , DB ::table ('tmdb_genre_tmdb_movie ' )->select ('tmdb_movie_id ' )->whereIn ('tmdb_genre_id ' , $ this ->genreIds ))
204
204
)
205
205
->orWhere (
206
206
fn ($ query ) => $ query
207
207
->whereRelation ('category ' , 'tv_meta ' , '= ' , true )
208
- ->whereIn ('tv_id ' , DB ::table ('genre_tv ' )->select ('tv_id ' )->whereIn ('genre_id ' , $ this ->genreIds ))
208
+ ->whereIn ('tmdb_tv_id ' , DB ::table ('tmdb_genre_tmdb_tv ' )->select ('tmdb_tv_id ' )->whereIn ('tmdb_genre_id ' , $ this ->genreIds ))
209
209
)
210
210
)
211
211
)
@@ -232,8 +232,8 @@ final public function toSqlQueryBuilder(): Closure
232
232
fn ($ query ) => $ query
233
233
->where (
234
234
fn ($ query ) => $ query
235
- ->where ('movie_id ' , '= ' , $ this ->tmdbId )
236
- ->orWhere ('tv_id ' , '= ' , $ this ->tmdbId )
235
+ ->where ('tmdb_movie_id ' , '= ' , $ this ->tmdbId )
236
+ ->orWhere ('tmdb_tv_id ' , '= ' , $ this ->tmdbId )
237
237
)
238
238
)
239
239
->when ($ this ->imdbId !== null , fn ($ query ) => $ query ->where ('imdb ' , '= ' , $ this ->imdbId ))
@@ -267,7 +267,7 @@ final public function toSqlQueryBuilder(): Closure
267
267
$ this ->collectionId !== null ,
268
268
fn ($ query ) => $ query
269
269
->whereRelation ('category ' , 'movie_meta ' , '= ' , true )
270
- ->whereIn ('movie_id ' , DB ::table ('collection_movie ' )->select ('movie_id ' )->where ('collection_id ' , '= ' , $ this ->collectionId ))
270
+ ->whereIn ('tmdb_movie_id ' , DB ::table ('tmdb_collection_tmdb_movie ' )->select ('tmdb_movie_id ' )->where ('tmdb_collection_id ' , '= ' , $ this ->collectionId ))
271
271
)
272
272
->when (
273
273
$ this ->companyId !== null ,
@@ -277,20 +277,20 @@ final public function toSqlQueryBuilder(): Closure
277
277
->where (
278
278
fn ($ query ) => $ query
279
279
->whereRelation ('category ' , 'movie_meta ' , '= ' , true )
280
- ->whereIn ('movie_id ' , DB ::table ('company_movie ' )->select ('movie_id ' )->where ('company_id ' , '= ' , $ this ->companyId ))
280
+ ->whereIn ('tmdb_movie_id ' , DB ::table ('tmdb_company_tmdb_movie ' )->select ('tmdb_movie_id ' )->where ('tmdb_company_id ' , '= ' , $ this ->companyId ))
281
281
)
282
282
->orWhere (
283
283
fn ($ query ) => $ query
284
284
->whereRelation ('category ' , 'tv_meta ' , '= ' , true )
285
- ->whereIn ('tv_id ' , DB ::table ('company_tv ' )->select ('tv_id ' )->where ('company_id ' , '= ' , $ this ->companyId ))
285
+ ->whereIn ('tmdb_tv_id ' , DB ::table ('tmdb_company_tmdb_tv ' )->select ('tmdb_tv_id ' )->where ('tmdb_company_id ' , '= ' , $ this ->companyId ))
286
286
)
287
287
)
288
288
)
289
289
->when (
290
290
$ this ->networkId !== null ,
291
291
fn ($ query ) => $ query
292
292
->whereRelation ('category ' , 'tv_meta ' , '= ' , true )
293
- ->whereIn ('tv_id ' , DB ::table ('network_tv ' )->select ('tv_id ' )->where ('network_id ' , '= ' , $ this ->networkId ))
293
+ ->whereIn ('tmdb_tv_id ' , DB ::table ('tmdb_network_tmdb_tv ' )->select ('tmdb_tv_id ' )->where ('tmdb_network_id ' , '= ' , $ this ->networkId ))
294
294
)
295
295
->when (
296
296
$ this ->primaryLanguageNames !== [],
@@ -369,12 +369,12 @@ final public function toSqlQueryBuilder(): Closure
369
369
->where (
370
370
fn ($ query ) => $ query
371
371
->whereRelation ('movie_meta ' , '= ' , true )
372
- ->whereIn ('movie_id ' , Wish::select ('movie_id ' )->where ('user_id ' , '= ' , $ this ->user ->id ))
372
+ ->whereIn ('tmdb_movie_id ' , Wish::select ('tmdb_movie_id ' )->where ('user_id ' , '= ' , $ this ->user ->id ))
373
373
)
374
374
->orWhere (
375
375
fn ($ query ) => $ query
376
376
->whereRelation ('tv_meta ' , '= ' , true )
377
- ->whereIn ('tv_id ' , Wish::select ('tv_id ' )->where ('user_id ' , '= ' , $ this ->user ->id ))
377
+ ->whereIn ('tmdb_tv_id ' , Wish::select ('tmdb_tv_id ' )->where ('user_id ' , '= ' , $ this ->user ->id ))
378
378
)
379
379
)
380
380
)
@@ -460,15 +460,15 @@ final public function toMeilisearchFilter(): array
460
460
461
461
if ($ this ->startYear !== null ) {
462
462
$ filters [] = [
463
- 'movie .year >= ' .$ this ->startYear ,
464
- 'tv .year >= ' .$ this ->startYear ,
463
+ 'tmdb_movie .year >= ' .$ this ->startYear ,
464
+ 'tmdb_tv .year >= ' .$ this ->startYear ,
465
465
];
466
466
}
467
467
468
468
if ($ this ->endYear !== null ) {
469
469
$ filters [] = [
470
- 'movie .year <= ' .$ this ->endYear ,
471
- 'tv .year <= ' .$ this ->endYear ,
470
+ 'tmdb_movie .year <= ' .$ this ->endYear ,
471
+ 'tmdb_tv .year <= ' .$ this ->endYear ,
472
472
];
473
473
}
474
474
@@ -502,8 +502,8 @@ final public function toMeilisearchFilter(): array
502
502
503
503
if ($ this ->genreIds !== []) {
504
504
$ filters [] = [
505
- 'movie .genres.id IN ' .json_encode (array_map ('intval ' , $ this ->genreIds )),
506
- 'tv .genres.id IN ' .json_encode (array_map ('intval ' , $ this ->genreIds )),
505
+ 'tmdb_movie .genres.id IN ' .json_encode (array_map ('intval ' , $ this ->genreIds )),
506
+ 'tmdb_tv .genres.id IN ' .json_encode (array_map ('intval ' , $ this ->genreIds )),
507
507
];
508
508
}
509
509
@@ -530,13 +530,13 @@ final public function toMeilisearchFilter(): array
530
530
}
531
531
532
532
if ($ this ->adult !== null ) {
533
- $ filters [] = 'movie .adult = ' .($ this ->adult ? 'true ' : 'false ' );
533
+ $ filters [] = 'tmdb_movie .adult = ' .($ this ->adult ? 'true ' : 'false ' );
534
534
}
535
535
536
536
if ($ this ->tmdbId !== null ) {
537
537
$ filters [] = [
538
- 'movie_id = ' .$ this ->tmdbId ,
539
- 'tv_id = ' .$ this ->tmdbId ,
538
+ 'tmdb_movie_id = ' .$ this ->tmdbId ,
539
+ 'tmdb_tv_id = ' .$ this ->tmdbId ,
540
540
];
541
541
}
542
542
@@ -557,24 +557,24 @@ final public function toMeilisearchFilter(): array
557
557
}
558
558
559
559
if ($ this ->collectionId !== null ) {
560
- $ filters [] = 'movie .collection.id = ' .$ this ->collectionId ;
560
+ $ filters [] = 'tmdb_movie .collection.id = ' .$ this ->collectionId ;
561
561
}
562
562
563
563
if ($ this ->companyId !== null ) {
564
564
$ filters [] = [
565
- 'movie .companies.id = ' .$ this ->companyId ,
566
- 'tv .companies.id = ' .$ this ->companyId ,
565
+ 'tmdb_movie .companies.id = ' .$ this ->companyId ,
566
+ 'tmdb_tv .companies.id = ' .$ this ->companyId ,
567
567
];
568
568
}
569
569
570
570
if ($ this ->networkId !== null ) {
571
- $ filters [] = 'tv .networks.id = ' .$ this ->networkId ;
571
+ $ filters [] = 'tmdb_tv .networks.id = ' .$ this ->networkId ;
572
572
}
573
573
574
574
if ($ this ->primaryLanguageNames !== []) {
575
575
$ filters [] = [
576
- 'movie .original_language IN ' .json_encode (array_map ('strval ' , $ this ->primaryLanguageNames )),
577
- 'tv .original_language IN ' .json_encode (array_map ('strval ' , $ this ->primaryLanguageNames )),
576
+ 'tmdb_movie .original_language IN ' .json_encode (array_map ('strval ' , $ this ->primaryLanguageNames )),
577
+ 'tmdb_tv .original_language IN ' .json_encode (array_map ('strval ' , $ this ->primaryLanguageNames )),
578
578
];
579
579
}
580
580
@@ -650,8 +650,8 @@ final public function toMeilisearchFilter(): array
650
650
651
651
if ($ this ->userWished ) {
652
652
$ filters [] = [
653
- 'movie .wishes.user_id = ' .$ this ->user ->id ,
654
- 'tv .wishes.user_id = ' .$ this ->user ->id ,
653
+ 'tmdb_movie .wishes.user_id = ' .$ this ->user ->id ,
654
+ 'tmdb_tv .wishes.user_id = ' .$ this ->user ->id ,
655
655
];
656
656
}
657
657
0 commit comments