|
@@ -57,7 +57,7 @@ func Home(c *movies.Collection) http.HandlerFunc {
|
57
|
57
|
|
58
|
58
|
if r.Method == "POST" {
|
59
|
59
|
if r.FormValue("omdb_json") != "" {
|
60
|
|
- m, err := movies.Unmarshal([]byte(r.FormValue("omdb_json")))
|
|
60
|
+ m, err := movies.UnmarshalFromOMDB([]byte(r.FormValue("omdb_json")))
|
61
|
61
|
if err != nil {
|
62
|
62
|
w.WriteHeader(http.StatusBadRequest)
|
63
|
63
|
errs = append(errs, err)
|
|
@@ -125,12 +125,14 @@ func Movie(c *movies.Collection) http.HandlerFunc {
|
125
|
125
|
errs = append(errs, fmt.Errorf("you cannot change the imdb id."))
|
126
|
126
|
} else {
|
127
|
127
|
m = updated
|
|
128
|
+ fmt.Println("Update with", m)
|
128
|
129
|
c.Update(updated)
|
129
|
130
|
}
|
130
|
131
|
}
|
131
|
132
|
|
132
|
133
|
if files := r.FormValue("files"); files != "" {
|
133
|
134
|
m.Files = strings.Split(files, "\n")
|
|
135
|
+ fmt.Println("Update with", m)
|
134
|
136
|
c.Update(m)
|
135
|
137
|
}
|
136
|
138
|
}
|