dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
907 stars 115 forks source link

move config file to .config for a cleaner home directory #175

Closed Monirzadeh closed 4 years ago

Monirzadeh commented 4 years ago

as i mention here #166

dbr commented 4 years ago

Thanks for the PR!

I'm definitely in favour of using the ~/.config/ folder, but this needs a fallback to still load ~/.tvnamer.conf for backwards compatibility with existing configs.

The ~/.config/... one would take preference, and the presence of the old config should output a warning. I imagine the logic would be:

  1. Check for ~/.config/tvnamer/tvnamer.json - load this if present
  2. If not present, check for ~/.tvnamer.json - load this
  3. If ~/.tvnamer.json is present, output warning informing user of new location (this should happen regardless if ~/.config/... file exists to avoid confusion)

I'm happy to make these changes for the next release if you don't have time!

Monirzadeh commented 4 years ago

OK i will do that :+1: UPDATE: i finish that user see warning in any condition if ~/.tvnamer.json exist. do you need to show different massage in different condition or a simple massage is enough? please write that massage.

i prefer simple massage but if you need different massage it can be something like this: 1.if ~/.config/tvnamer/tvnamer.json and ~/.tvnamer.json exist >> please remove old ~/.tvnamer.json file

  1. if only ~/.config/tvnamer/tvnamer.json exist >> don't show anything
  2. if ~/.config/tvnamer/tvnamer.json not exist and ~/.tvnamer.json exist >> please move ~/.tvnamer.json to ~/.config/tvnamer/tvnamer.json
dbr commented 4 years ago

Looks good to me! I think a single message if the old config file exists is fine - there's a minor typo in the message but easier for me to tweak that after merging.

Thanks! I think this is the last improvement I wanted to sort out before releasing v2.6, shall hopefully get to that in the next few days