feat(storage): rename snapraid_content to snapraid_conf; clarify conf vs content file; add auto-detect and conf viewer
This commit is contained in:
@@ -19,7 +19,7 @@ func scanStorageConfig(row interface {
|
||||
&removeSource,
|
||||
&inplace,
|
||||
&c.MoverRsyncOptions,
|
||||
&c.SnapraidContent,
|
||||
&c.SnapraidConf,
|
||||
&c.SnapraidDataDirs,
|
||||
&c.SnapraidParityDir,
|
||||
&c.SnapraidScrubPlan,
|
||||
@@ -36,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, mover_warning_threshold, 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_conf, 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 +51,11 @@ func (d *DB) UpdateStorageConfig(c StorageConfig) error {
|
||||
_, err := d.conn.Exec(`
|
||||
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=?,
|
||||
mover_rsync_options=?, snapraid_conf=?, snapraid_data_dirs=?, snapraid_parity_dir=?,
|
||||
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.MoverRsyncOptions, c.SnapraidConf, c.SnapraidDataDirs, c.SnapraidParityDir,
|
||||
c.SnapraidScrubPlan, c.MoverWarningThreshold, c.ID,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user