Be sure to have an array in Genres before commit
This commit is contained in:
parent
23c477b27e
commit
6c0f4519cc
@ -64,6 +64,10 @@ type MovieDB struct {
|
||||
// NewMovieDB returns a Movie ready to be put in DB from a
|
||||
// Movie
|
||||
func NewMovieDB(m *Movie) MovieDB {
|
||||
genres := []string{}
|
||||
if m.Genres != nil {
|
||||
genres = m.Genres
|
||||
}
|
||||
return MovieDB{
|
||||
ID: m.ID,
|
||||
ImdbID: m.ImdbID,
|
||||
@ -77,7 +81,7 @@ func NewMovieDB(m *Movie) MovieDB {
|
||||
Runtime: m.Runtime,
|
||||
SortTitle: m.SortTitle,
|
||||
Tagline: m.Tagline,
|
||||
Genres: m.Genres,
|
||||
Genres: genres,
|
||||
Created: m.Created,
|
||||
Updated: m.Updated,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user