Movies Section (#338)

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
caustico
2020-03-10 04:28:15 +01:00
committed by GitHub
parent b3fab3cfef
commit 5fb8bbf768
79 changed files with 2278 additions and 27 deletions

View File

@@ -147,6 +147,28 @@ func (r *mutationResolver) sceneUpdate(input models.SceneUpdateInput, tx *sqlx.T
return nil, err
}
// Save the movies
var movieJoins []models.MoviesScenes
for _, movie := range input.Movies {
movieID, _ := strconv.Atoi(movie.MovieID)
sceneIdx := ""
if movie.SceneIndex != nil {
sceneIdx = *movie.SceneIndex
}
movieJoin := models.MoviesScenes{
MovieID: movieID,
SceneID: sceneID,
SceneIndex: sceneIdx,
}
movieJoins = append(movieJoins, movieJoin)
}
if err := jqb.UpdateMoviesScenes(sceneID, movieJoins, tx); err != nil {
return nil, err
}
// Save the tags
var tagJoins []models.ScenesTags
for _, tid := range input.TagIds {