Use database status and health, calculate md5

This commit is contained in:
Samuel Lorch 2024-05-11 00:43:26 +02:00
parent 806f6e7e61
commit 78d818b8d1
7 changed files with 112 additions and 37 deletions

View file

@ -52,7 +52,7 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {
}()
var size int
err := db.QueryRow(r.Context(), "SELECT SUM(size) AS size FROM files WHERE missing = $1", false).Scan(&size)
err := db.QueryRow(r.Context(), "SELECT SUM(size) AS size FROM files WHERE status = $1", constants.FILE_STATUS_EXISTS).Scan(&size)
if err != nil {
size = 0
}