diff --git a/server/task.go b/server/task.go
index d86d899..bfc6d16 100644
--- a/server/task.go
+++ b/server/task.go
@@ -260,6 +260,7 @@ func createTask(ctx context.Context, r *http.Request) error {
}
library := r.FormValue("library")
health := r.FormValue("health")
+ transcode := r.FormValue("transcode")
typ, err := strconv.Atoi(r.FormValue("type"))
if err != nil {
return fmt.Errorf("Parsing Task Type: %w", err)
@@ -271,7 +272,7 @@ func createTask(ctx context.Context, r *http.Request) error {
slog.Info("Got Task Create", "library", library, "health", health, "type", typ)
- rows, err := db.Query(r.Context(), "SELECT id, path, size, status, health, transcode, md5, updated_at FROM files where library_id = $1 AND status = $2 AND (-1 = $3 OR health = $3)", library, constants.FILE_STATUS_EXISTS, health)
+ rows, err := db.Query(r.Context(), "SELECT id, path, size, status, health, transcode, md5, updated_at FROM files where library_id = $1 AND status = $2 AND (-1 = $3 OR health = $3) AND (-1 = $4 OR transcode = $4)", library, constants.FILE_STATUS_EXISTS, health, transcode)
if err != nil {
return fmt.Errorf("Query Files: %w", err)
}
diff --git a/tmpl/tasks.tmpl b/tmpl/tasks.tmpl
index 647bca2..6220bcd 100644
--- a/tmpl/tasks.tmpl
+++ b/tmpl/tasks.tmpl
@@ -15,6 +15,14 @@
+
+