diff --git a/server/task.go b/server/task.go
index 9e63980..23bf2a7 100644
--- a/server/task.go
+++ b/server/task.go
@@ -169,10 +169,11 @@ func createTask(ctx context.Context, r *http.Request) error {
return fmt.Errorf("Parseing Form: %w", err)
}
library := r.FormValue("library")
+ health := r.FormValue("health")
typ := r.FormValue("type")
- slog.Info("Got Task Create", "library", library, "type", typ)
+ slog.Info("Got Task Create", "library", library, "health", health, "type", typ)
- rows, err := db.Query(r.Context(), "SELECT id, path, size, status, health, md5 FROM files where library_id = $1 AND status = $2", library, constants.FILE_STATUS_EXISTS)
+ rows, err := db.Query(r.Context(), "SELECT id, path, size, status, health, md5 FROM files where library_id = $1 AND status = $2 AND (-1 = $3 OR health = $3)", library, constants.FILE_STATUS_EXISTS, health)
if err != nil {
return fmt.Errorf("Query Files: %w", err)
}
diff --git a/tmpl/tasks.tmpl b/tmpl/tasks.tmpl
index bced8e4..7a2d629 100644
--- a/tmpl/tasks.tmpl
+++ b/tmpl/tasks.tmpl
@@ -7,6 +7,13 @@
{{end}}
+
+