dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
675 stars 26 forks source link

Periodically save config file while app is running #277

Closed dweymouth closed 7 months ago

dweymouth commented 7 months ago

This would prevent possible loss of settings if Supersonic crashes or doesn't exit normally. (Resolving #275)

Completion criteria:

  1. Config backend periodically saves the settings to the backing file while app is running (every 2 min?)
  2. This only occurs if there has been a change in config. (Since the config is just a big struct with no pointers, this should be a simple equality check) 2a. Before saving the config file while the app is running, duplicate the config struct 2b. Next settings-save task compares the duplicated config struct to the "live" one 2c. If no change, nothing is done. Otherwise trigger the file-write+duplicate struct logic