coderholic / pyradio

Curses based internet radio player
www.coderholic.com/pyradio
MIT License
961 stars 129 forks source link

Save only configuration options that differ from defaults. #220

Closed amano-kenji closed 6 months ago

amano-kenji commented 10 months ago

Because pyradio writes all options to configuration files, when option defaults change, users are stuck with previous default values.

To automatically migrate users to new option defaults, pyradio should save only configuration options that differ from defaults.

Since not all configuration options are going to be in configuration files, pyradio will have to document all configuration options with their default values somewhere else for people who want to configure options manually. For example, pyradio could show all configuration options with their default values in a text box when user presses a keyboard shortcut. Or, pyradio --show-option-defaults could print a full configuration file to standard output.

s-n-g commented 10 months ago

Yes, I see what you mean about the default options changes... but that rarely happens... I'll think about it though

The SEARCH_TERM part should probably be in a json file; these should not be changed manually

amano-kenji commented 10 months ago

This is also good for putting configuration files in git repository.

I want to track which configuration options differ from the defaults in my git repository of configuration files.

If a configuration file has every option, then I don't remember which options I changed.

amano-kenji commented 9 months ago

I think SEARCH_TERM belongs in something like $XDG_DATA_HOME/pyradio/radiobrowser_search_term.

s-n-g commented 9 months ago

It will probably end up in a json file, something like radiobrowser.json...

Too many things to do, too little time to spare :)

amano-kenji commented 9 months ago

At least, I clearly defined what should be done. You can come back to any defined issue when you have time.

s-n-g commented 6 months ago

Done in 0.9.3