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

@@ -161,7 +161,7 @@ func (qb *JoinsQueryBuilder) CreateMoviesScenes(newJoins []MoviesScenes, tx *sql
// if the movie already exists on the scene. It returns true if scene
// movie was added.
func (qb *JoinsQueryBuilder) AddMoviesScene(sceneID int, movieID int, sceneIdx string, tx *sqlx.Tx) (bool, error) {
func (qb *JoinsQueryBuilder) AddMoviesScene(sceneID int, movieID int, sceneIdx *int, tx *sqlx.Tx) (bool, error) {
ensureTx(tx)
existingMovies, err := qb.GetSceneMovies(sceneID, tx)
@@ -178,9 +178,15 @@ func (qb *JoinsQueryBuilder) AddMoviesScene(sceneID int, movieID int, sceneIdx s
}
movieJoin := MoviesScenes{
MovieID: movieID,
SceneID: sceneID,
SceneIndex: sceneIdx,
MovieID: movieID,
SceneID: sceneID,
}
if sceneIdx != nil {
movieJoin.SceneIndex = sql.NullInt64{
Int64: int64(*sceneIdx),
Valid: true,
}
}
movieJoins := append(existingMovies, movieJoin)