|
@@ -83,12 +83,14 @@ func Home(c *movies.Collection) http.HandlerFunc {
|
83
|
83
|
}
|
84
|
84
|
}
|
85
|
85
|
|
86
|
|
- t.Execute(w, map[string]interface{}{
|
|
86
|
+ if err := t.Execute(w, map[string]interface{}{
|
87
|
87
|
"Collection": c,
|
88
|
88
|
"IMDBID": r.URL.Query().Get("imdb_id"),
|
89
|
89
|
"OMDBString": omdbString,
|
90
|
90
|
"Errors": errs,
|
91
|
|
- })
|
|
91
|
+ }); err != nil {
|
|
92
|
+ fmt.Println(err)
|
|
93
|
+ }
|
92
|
94
|
})
|
93
|
95
|
}
|
94
|
96
|
|
|
@@ -135,6 +137,14 @@ func Movie(c *movies.Collection) http.HandlerFunc {
|
135
|
137
|
fmt.Println("Update with", m)
|
136
|
138
|
c.Update(m)
|
137
|
139
|
}
|
|
140
|
+
|
|
141
|
+ if r.FormValue("generate_mediainfo") != "" {
|
|
142
|
+ if err := m.GenerateMediaInfo(); err != nil {
|
|
143
|
+ errs = append(errs, err)
|
|
144
|
+ } else {
|
|
145
|
+ c.Update(m)
|
|
146
|
+ }
|
|
147
|
+ }
|
138
|
148
|
}
|
139
|
149
|
|
140
|
150
|
fileQuery := r.URL.Query().Get("file_query")
|
|
@@ -148,14 +158,16 @@ func Movie(c *movies.Collection) http.HandlerFunc {
|
148
|
158
|
errs = append(errs, err)
|
149
|
159
|
}
|
150
|
160
|
|
151
|
|
- t.Execute(w, map[string]interface{}{
|
|
161
|
+ if err := t.Execute(w, map[string]interface{}{
|
152
|
162
|
"Movie": m,
|
153
|
163
|
"MovieJSON": string(b),
|
154
|
164
|
"Files": strings.Join(m.Files, "\n"),
|
155
|
165
|
"FileQuery": fileQuery,
|
156
|
166
|
"FileResults": fileResults,
|
157
|
167
|
"Errors": errs,
|
158
|
|
- })
|
|
168
|
+ }); err != nil {
|
|
169
|
+ fmt.Println(err)
|
|
170
|
+ }
|
159
|
171
|
})
|
160
|
172
|
}
|
161
|
173
|
|
|
@@ -206,7 +218,7 @@ func List(c *movies.Collection) http.HandlerFunc {
|
206
|
218
|
}
|
207
|
219
|
}
|
208
|
220
|
|
209
|
|
- t.Execute(w, map[string]interface{}{
|
|
221
|
+ if err := t.Execute(w, map[string]interface{}{
|
210
|
222
|
"List": l,
|
211
|
223
|
"Description": template.HTML(
|
212
|
224
|
blackfriday.Run(
|
|
@@ -215,7 +227,9 @@ func List(c *movies.Collection) http.HandlerFunc {
|
215
|
227
|
"Movies": ms,
|
216
|
228
|
"ListJSON": string(b),
|
217
|
229
|
"Errors": errs,
|
218
|
|
- })
|
|
230
|
+ }); err != nil {
|
|
231
|
+ fmt.Println(err)
|
|
232
|
+ }
|
219
|
233
|
})
|
220
|
234
|
}
|
221
|
235
|
|
|
@@ -244,10 +258,12 @@ func Files(c *movies.Collection) http.HandlerFunc {
|
244
|
258
|
}
|
245
|
259
|
}
|
246
|
260
|
|
247
|
|
- t.Execute(w, map[string]interface{}{
|
|
261
|
+ if err := t.Execute(w, map[string]interface{}{
|
248
|
262
|
"Files": c.AllFiles(),
|
249
|
263
|
"Errors": errs,
|
250
|
|
- })
|
|
264
|
+ }); err != nil {
|
|
265
|
+ fmt.Println(err)
|
|
266
|
+ }
|
251
|
267
|
})
|
252
|
268
|
}
|
253
|
269
|
|