Add Transcode Status Filter for Task Creation
All checks were successful
/ release (push) Successful in 39s
All checks were successful
/ release (push) Successful in 39s
This commit is contained in:
parent
eb3cfbfdba
commit
8046093e9e
2 changed files with 10 additions and 1 deletions
|
@ -260,6 +260,7 @@ func createTask(ctx context.Context, r *http.Request) error {
|
||||||
}
|
}
|
||||||
library := r.FormValue("library")
|
library := r.FormValue("library")
|
||||||
health := r.FormValue("health")
|
health := r.FormValue("health")
|
||||||
|
transcode := r.FormValue("transcode")
|
||||||
typ, err := strconv.Atoi(r.FormValue("type"))
|
typ, err := strconv.Atoi(r.FormValue("type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Parsing Task Type: %w", err)
|
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)
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("Query Files: %w", err)
|
return fmt.Errorf("Query Files: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,14 @@
|
||||||
<option value="1">Damaged</option>
|
<option value="1">Damaged</option>
|
||||||
<option value="2">Healthy</option>
|
<option value="2">Healthy</option>
|
||||||
</select>
|
</select>
|
||||||
|
<label for="transcode">Transcode Status</label>
|
||||||
|
<select id="transcode" name="transcode">
|
||||||
|
<option value="-1">All</option>
|
||||||
|
<option value="0">Unknown</option>
|
||||||
|
<option value="1">None</option>
|
||||||
|
<option value="2">Failed</option>
|
||||||
|
<option value="2">Success</option>
|
||||||
|
</select>
|
||||||
<label for="type">Type</label>
|
<label for="type">Type</label>
|
||||||
<select id="type" name="type">
|
<select id="type" name="type">
|
||||||
<option value="0">Health Check</option>
|
<option value="0">Health Check</option>
|
||||||
|
|
Loading…
Add table
Reference in a new issue