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) {
|
||||
var err error
|
||||
id := mux.Vars(req.r)["id"]
|
||||
search := strings.Join(req.r.Form["q"], " ")
|
||||
fmt := req.r.FormValue("fmt")
|
||||
|
@ -155,6 +154,11 @@ func (sg StatsGatherer) save(req statsRequest) {
|
|||
Fmt: fmt,
|
||||
Duration: req.duration,
|
||||
})
|
||||
|
||||
_, err := sg.db.GetBookID(id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
switch section {
|
||||
case "download":
|
||||
err = sg.db.IncDownloads(id)
|
||||
|
|
Reference in a new issue