parent
5bcb08ef37
commit
17b9612f94
1 changed files with 5 additions and 1 deletions
|
@ -137,7 +137,6 @@ func (sg StatsGatherer) worker() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sg StatsGatherer) save(req statsRequest) {
|
func (sg StatsGatherer) save(req statsRequest) {
|
||||||
var err error
|
|
||||||
id := mux.Vars(req.r)["id"]
|
id := mux.Vars(req.r)["id"]
|
||||||
search := strings.Join(req.r.Form["q"], " ")
|
search := strings.Join(req.r.Form["q"], " ")
|
||||||
fmt := req.r.FormValue("fmt")
|
fmt := req.r.FormValue("fmt")
|
||||||
|
@ -155,6 +154,11 @@ func (sg StatsGatherer) save(req statsRequest) {
|
||||||
Fmt: fmt,
|
Fmt: fmt,
|
||||||
Duration: req.duration,
|
Duration: req.duration,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
_, err := sg.db.GetBookID(id)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
switch section {
|
switch section {
|
||||||
case "download":
|
case "download":
|
||||||
err = sg.db.IncDownloads(id)
|
err = sg.db.IncDownloads(id)
|
||||||
|
|
Reference in a new issue