Skip to content

Commit 1d78cda

Browse files
committed
remove: seasons, episodes, guest_stars
These tables and models aren't used anymore. Seasons and episodes aren't used because most torrents do not follow tmdb's episode and season ordering, but instead follow tvdb's, so it is more accurate to specify the episode and season number directly. Guest stars haven't been used for a long time, if ever. Fixes #4565
1 parent 2a5c823 commit 1d78cda

File tree

14 files changed

+30
-641
lines changed

14 files changed

+30
-641
lines changed

app/Http/Controllers/RequestController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public function show(Request $request, TorrentRequest $torrentRequest): \Illumin
7171
'genres',
7272
'credits' => ['person', 'occupation'],
7373
'networks',
74-
'seasons'
7574
])
7675
->find($torrentRequest->tmdb_tv_id),
7776
($torrentRequest->category->movie_meta && $torrentRequest->tmdb_movie_id) => TmdbMovie::with([

app/Http/Livewire/TmdbTvSearch.php

Lines changed: 0 additions & 58 deletions
This file was deleted.

app/Jobs/ProcessTvJob.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818

1919
use App\Models\TmdbCompany;
2020
use App\Models\TmdbCredit;
21-
use App\Models\TmdbEpisode;
2221
use App\Models\TmdbGenre;
2322
use App\Models\TmdbNetwork;
2423
use App\Models\TmdbPerson;
2524
use App\Models\TmdbRecommendation;
26-
use App\Models\TmdbSeason;
2725
use App\Models\Torrent;
2826
use App\Models\TmdbTv;
2927
use App\Services\Tmdb\Client;
@@ -106,21 +104,6 @@ public function handle(): void
106104
TmdbCredit::where('tmdb_tv_id', '=', $this->id)->delete();
107105
TmdbCredit::upsert($credits, ['tmdb_person_id', 'tmdb_movie_id', 'tmdb_tv_id', 'occupation_id', 'character']);
108106

109-
// Seasons and episodes
110-
111-
$seasons = [];
112-
$episodes = [];
113-
114-
foreach ($tvScraper->getSeasons() as $season) {
115-
$seasonScraper = new Client\Season($this->id, $season['season_number']);
116-
117-
$seasons[] = $seasonScraper->getSeason();
118-
array_push($episodes, ...$seasonScraper->getEpisodes());
119-
}
120-
121-
TmdbSeason::upsert($seasons, 'id');
122-
TmdbEpisode::upsert($episodes, 'id');
123-
124107
// Recommendations
125108

126109
TmdbRecommendation::upsert($tvScraper->getRecommendations(), ['recommended_tmdb_tv_id', 'tmdb_tv_id']);

app/Models/GuestStar.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/Models/TmdbEpisode.php

Lines changed: 0 additions & 61 deletions
This file was deleted.

app/Models/TmdbSeason.php

Lines changed: 0 additions & 70 deletions
This file was deleted.

app/Models/TmdbTv.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@ public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
8888
return $this->hasMany(Torrent::class)->whereRelation('category', 'tv_meta', '=', true);
8989
}
9090

91-
/**
92-
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TmdbSeason, $this>
93-
*/
94-
public function seasons(): \Illuminate\Database\Eloquent\Relations\HasMany
95-
{
96-
return $this->hasMany(TmdbSeason::class)
97-
->oldest('season_number');
98-
}
99-
10091
/**
10192
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
10293
*/

0 commit comments

Comments
 (0)