Fix Empty Librarys

This commit is contained in:
Samuel Lorch 2024-05-09 04:42:54 +02:00
parent 4e0df234f1
commit fa0f543feb

View file

@ -65,9 +65,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)
if err != nil {
slog.ErrorContext(r.Context(), "Query File Size Sum", "err", err)
http.Error(w, "Error Query File Size Sum: "+err.Error(), http.StatusInternalServerError)
return
size = 0
}
data.Counter = splitInt(size)