Skip to content

Commit a126615

Browse files
committed
fix: network and company torrent relations
The two fields were incorrectly swapped.
1 parent e9acd76 commit a126615

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/Models/TmdbCompany.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
6060
*/
6161
public function movieTorrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
6262
{
63-
return $this->belongsToMany(Torrent::class, 'tmdb_company_tmdb_movie', 'tmdb_movie_id', 'tmdb_company_id', 'id', 'tmdb_movie_id')->whereRelation('category', 'movie_meta', '=', true);
63+
return $this->belongsToMany(Torrent::class, 'tmdb_company_tmdb_movie', 'tmdb_company_id', 'tmdb_movie_id', 'id', 'tmdb_movie_id')->whereRelation('category', 'movie_meta', '=', true);
6464
}
6565

6666
/**
6767
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Torrent, $this>
6868
*/
6969
public function tvTorrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
7070
{
71-
return $this->belongsToMany(Torrent::class, 'tmdb_company_tmdb_tv', 'tmdb_tv_id', 'tmdb_company_id', 'id', 'tmdb_tv_id')->whereRelation('category', 'tv_meta', '=', true);
71+
return $this->belongsToMany(Torrent::class, 'tmdb_company_tmdb_tv', 'tmdb_company_id', 'tmdb_tv_id', 'id', 'tmdb_tv_id')->whereRelation('category', 'tv_meta', '=', true);
7272
}
7373
}

app/Models/TmdbNetwork.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
6060
*/
6161
public function tvTorrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
6262
{
63-
return $this->belongsToMany(Torrent::class, 'tmdb_network_tmdb_tv', 'tmdb_tv_id', 'tmdb_network_id', 'id', 'tmdb_tv_id')->whereRelation('category', 'tv_meta', '=', true);
63+
return $this->belongsToMany(Torrent::class, 'tmdb_network_tmdb_tv', 'tmdb_network_id', 'tmdb_tv_id', 'id', 'tmdb_tv_id')->whereRelation('category', 'tv_meta', '=', true);
6464
}
6565
}

0 commit comments

Comments
 (0)