Reschedule before scan

This commit is contained in:
Jakob Borg 2015-05-03 14:18:50 +02:00
parent 1bd85d8baf
commit bd5a64bac0

View File

@ -775,8 +775,14 @@ func (s *apiSvc) postDBScan(w http.ResponseWriter, r *http.Request) {
qs := r.URL.Query()
folder := qs.Get("folder")
if folder != "" {
nextStr := qs.Get("next")
next, err := strconv.Atoi(nextStr)
if err == nil {
s.model.DelayScan(folder, time.Duration(next)*time.Second)
}
subs := qs["sub"]
err := s.model.ScanFolderSubs(folder, subs)
err = s.model.ScanFolderSubs(folder, subs)
if err != nil {
http.Error(w, err.Error(), 500)
return
@ -789,11 +795,6 @@ func (s *apiSvc) postDBScan(w http.ResponseWriter, r *http.Request) {
return
}
}
nextStr := qs.Get("next")
next, err := strconv.Atoi(nextStr)
if err == nil {
s.model.DelayScan(folder, time.Duration(next)*time.Second)
}
}
func (s *apiSvc) postDBPrio(w http.ResponseWriter, r *http.Request) {