diff --git a/Makefile b/Makefile index 6c1db85..26ab218 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BINARY=nasctl -VERSION?=0.7.4 +VERSION?=0.7.5 GO?=go LDFLAGS=-s -w -X github.com/darroyo/nasctl/internal/web.Version=$(VERSION) -X github.com/darroyo/nasctl/internal/web.Commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) BUILD_FLAGS=CGO_ENABLED=0 diff --git a/internal/db/queries_storage.go b/internal/db/queries_storage.go index a164099..16e682d 100644 --- a/internal/db/queries_storage.go +++ b/internal/db/queries_storage.go @@ -23,6 +23,7 @@ func scanStorageConfig(row interface { &c.SnapraidDataDirs, &c.SnapraidParityDir, &c.SnapraidScrubPlan, + &c.MoverWarningThreshold, &createdAt, ); err != nil { return StorageConfig{}, err @@ -35,7 +36,7 @@ func scanStorageConfig(row interface { } func (d *DB) GetStorageConfig() (StorageConfig, error) { - row := d.conn.QueryRow(`SELECT id, mover_source, mover_dest, mover_clean_macos, mover_remove_source, mover_inplace, mover_rsync_options, snapraid_content, snapraid_data_dirs, snapraid_parity_dir, snapraid_scrub_plan, updated_at FROM storage_config WHERE id = 1`) + row := d.conn.QueryRow(`SELECT id, mover_source, mover_dest, mover_clean_macos, mover_remove_source, mover_inplace, mover_rsync_options, snapraid_content, snapraid_data_dirs, snapraid_parity_dir, snapraid_scrub_plan, mover_warning_threshold, updated_at FROM storage_config WHERE id = 1`) c, err := scanStorageConfig(row) if err == sql.ErrNoRows { return StorageConfig{ID: 1, MoverCleanMacOS: true, MoverRemoveSource: true, MoverInplace: true, SnapraidScrubPlan: 8}, nil @@ -51,11 +52,11 @@ func (d *DB) UpdateStorageConfig(c StorageConfig) error { UPDATE storage_config SET mover_source=?, mover_dest=?, mover_clean_macos=?, mover_remove_source=?, mover_inplace=?, mover_rsync_options=?, snapraid_content=?, snapraid_data_dirs=?, snapraid_parity_dir=?, - snapraid_scrub_plan=?, updated_at=datetime('now') + snapraid_scrub_plan=?, mover_warning_threshold=?, updated_at=datetime('now') WHERE id=1`, c.MoverSource, c.MoverDest, toInt(c.MoverCleanMacOS), toInt(c.MoverRemoveSource), toInt(c.MoverInplace), c.MoverRsyncOptions, c.SnapraidContent, c.SnapraidDataDirs, c.SnapraidParityDir, - c.SnapraidScrubPlan, c.ID, + c.SnapraidScrubPlan, c.MoverWarningThreshold, c.ID, ) if err != nil { return fmt.Errorf("update storage config: %w", err)