func GetSceneMoviesJSON(movieReader models.MovieReader, sceneReader models.SceneReader, scene *models.Scene) ([]jsonschema.SceneMovie, error) {
	sceneMovies, err := sceneReader.GetMovies(scene.ID)
	if err != nil {
		return nil, fmt.Errorf("error getting scene movies: %v", err)
	}

	var results []jsonschema.SceneMovie
	for _, sceneMovie := range sceneMovies {
		movie, err := movieReader.Find(sceneMovie.MovieID)
		if err != nil {
			return nil, fmt.Errorf("error getting movie: %v", err)
		}

		if movie.Name.Valid {
			sceneMovieJSON := jsonschema.SceneMovie{
				MovieName:  movie.Name.String,
				SceneIndex: int(sceneMovie.SceneIndex.Int64),
			}
			results = append(results, sceneMovieJSON)
		}
	}

	return results, nil
}
// GetSceneMoviesJSON returns a slice of SceneMovie JSON representation objects
// corresponding to the provided scene's scene movie relationships.
GetSceneMoviesJSON returns a slice of SceneMovie JSON representation objects
corresponding to the provided scene's scene movie relationships.
// GetSceneMoviesJSON returns a slice of SceneMovie JSON representation objects // corresponding to the provided scene ' s scene movie relationships .
func GetSceneMoviesJSON(movieReader models.MovieReader, sceneReader models.SceneReader, scene *models.Scene) ([]jsonschema.SceneMovie, error) {
	sceneMovies, err := sceneReader.GetMovies(scene.ID)
	if err != nil {
		return nil, fmt.Errorf("error getting scene movies: %v", err)
	}
	var results []jsonschema.SceneMovie
	for _, sceneMovie := range sceneMovies {
		movie, err := movieReader.Find(sceneMovie.MovieID)
		if err != nil {
			return nil, fmt.Errorf("error getting movie: %v", err)
		}
		if movie.Name.Valid {
			sceneMovieJSON := jsonschema.SceneMovie{
				MovieName:  movie.Name.String,
				SceneIndex: int(sceneMovie.SceneIndex.Int64),
			}
			results = append(results, sceneMovieJSON)
		}
	}
	return results, nil
}
func GetSceneMoviesJSON ( movieReader models . MovieReader , sceneReader models . SceneReader , scene * models . Scene ) ( [ ] jsonschema . SceneMovie , error ) { sceneMovies , err := sceneReader . GetMovies ( scene . ID ) if err != nil { return nil , fmt . Errorf ( " " , err ) } var results [ ] jsonschema . SceneMovie for _ , sceneMovie := range sceneMovies { movie , err := movieReader . Find ( sceneMovie . MovieID ) if err != nil { return nil , fmt . Errorf ( " " , err ) } if movie . Name . Valid { sceneMovieJSON := jsonschema . SceneMovie { MovieName : movie . Name . String , SceneIndex : int ( sceneMovie . SceneIndex . Int64 ) , } results = append ( results , sceneMovieJSON ) } } return results , nil }
GetSceneMoviesJSON returns a slice of SceneMovie JSON representation objects
corresponding to the provided scene's scene movie relationships.
GetSceneMoviesJSON returns a slice of SceneMovie JSON representation objects corresponding to the provided scene ' s scene movie relationships .