Add Studio to movie and fix movie schema (#458)

* Add movie migration
* Update server and UI code for type changes
* Add studio to movies
* Movie blobs to end
* Document movie duration
* Add filtering on movie studio
This commit is contained in:
WithoutPants
2020-04-22 11:22:14 +10:00
committed by GitHub
parent f21e04dcbc
commit eee7adfb85
30 changed files with 531 additions and 144 deletions

View File

@@ -153,16 +153,19 @@ func (r *mutationResolver) sceneUpdate(input models.SceneUpdateInput, tx *sqlx.T
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,
MovieID: movieID,
SceneID: sceneID,
}
if movie.SceneIndex != nil {
movieJoin.SceneIndex = sql.NullInt64{
Int64: int64(*movie.SceneIndex),
Valid: true,
}
}
movieJoins = append(movieJoins, movieJoin)
}
if err := jqb.UpdateMoviesScenes(sceneID, movieJoins, tx); err != nil {