Skip to content

Commit

Permalink
Update releases with proper movieinfo_id when updating movies on movi…
Browse files Browse the repository at this point in the history
…es list
  • Loading branch information
DariusIII committed Sep 20, 2018
1 parent f461ecc commit c3b6980
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2018-09-20 DariusIII
* Chg: Update releases with proper movieinfo_id when updating movies on movies list
* Chg: Update API v2 movie lookup description by adding traktid lookup example
* Chg: Update profile template
* Chg: Check for false response from getRawHtml function in FanartTV class
Expand Down
12 changes: 11 additions & 1 deletion app/Http/Controllers/Admin/MovieController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ public function create(Request $request)

if ($request->has('id') && \strlen($id) === 7) {
$movCheck = $movie->getMovieInfo($id);
if ($movie->updateMovieInfo($id) === true && ($movCheck === null || ($request->has('update') && $request->input('update') === 1))) {
$movieInfo = $movie->updateMovieInfo($id);
if ($movieInfo === true && ($movCheck === null || ($request->has('update') === true && (int) $request->input('update') === 1))) {
$forUpdate = Release::query()->where('imdbid', $id)->get(['id']);
if ($forUpdate !== null) {
$movieInfoId = MovieInfo::query()->where('imdbid', $id)->first(['id']);
if ($movieInfoId !== null) {
foreach ($forUpdate as $movie) {
Release::query()->where('id', $movie->id)->update(['movieinfo_id' => $movieInfoId->id]);
}
}
}
return redirect('admin/movie-list');
}

Expand Down

0 comments on commit c3b6980

Please sign in to comment.