Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
[settings] Fix loading old settings
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Jan 9, 2021
1 parent 31aedf2 commit bd7bc27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mp3monitoring/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def load_old_config(file: Path) -> List[JobConfig]:


def load_config(file: Path = Path.home().joinpath(".mp3monitoring/config.json")) -> tuple[Settings, List[JobConfig]]:
# load config file from version <=1.0.3
load_old_config(Path.home() / 'MP3-Monitoring' / 'data.sav')

if not file.exists():
file.parent.mkdir(exist_ok=True, parents=True)
return Settings(), []
# load config file from version <=1.0.3
jobs = load_old_config(Path.home() / 'MP3-Monitoring' / 'data.sav')

return Settings(), jobs

with file.open(encoding='utf-8') as reader:
j_dict: dict = json.load(reader)
Expand Down

0 comments on commit bd7bc27

Please sign in to comment.