From 1befac8d0e2b5a5452a7c4b7a12571e42cc1758f Mon Sep 17 00:00:00 2001 From: Pieter Goetschalckx <3.14.e.ter@gmail.com> Date: Wed, 18 Sep 2019 13:34:39 +0200 Subject: [PATCH 1/2] Set default externalPlayerPath --- src/renderer/lib/state.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/lib/state.js b/src/renderer/lib/state.js index ae17f57d27..9157eb7d80 100644 --- a/src/renderer/lib/state.js +++ b/src/renderer/lib/state.js @@ -119,7 +119,7 @@ function setupStateSaved () { downloadPath: config.DEFAULT_DOWNLOAD_PATH, isFileHandler: false, openExternalPlayer: false, - externalPlayerPath: null, + externalPlayerPath: '', startup: false, soundNotifications: true, autoAddTorrents: false, @@ -207,6 +207,8 @@ function load (cb) { onSavedState(err) return } + } else if (saved.prefs.externalPlayerPath == null) { + saved.prefs.externalPlayerPath = '' } onSavedState(null, saved) }) From f5ab39be8eb8f75b155e9b0b31643ea09bc8827f Mon Sep 17 00:00:00 2001 From: Pieter Goetschalckx <3.14.e.ter@gmail.com> Date: Thu, 19 Sep 2019 15:22:49 +0200 Subject: [PATCH 2/2] Migrate config file --- src/renderer/lib/migrations.js | 7 +++++++ src/renderer/lib/state.js | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/lib/migrations.js b/src/renderer/lib/migrations.js index 55e7b153eb..a719583d17 100644 --- a/src/renderer/lib/migrations.js +++ b/src/renderer/lib/migrations.js @@ -29,6 +29,7 @@ function run (state) { if (semver.lt(version, '0.17.0')) migrate_0_17_0(saved) if (semver.lt(version, '0.17.2')) migrate_0_17_2(saved) if (semver.lt(version, '0.21.0')) migrate_0_21_0(saved) + if (semver.lt(version, '0.21.1')) migrate_0_21_1(saved) // Config is now on the new version state.saved.version = config.APP_VERSION @@ -214,3 +215,9 @@ function migrate_0_21_0 (saved) { saved.prefs.soundNotifications = true } } + +function migrate_0_21_1 (saved) { + if (saved.prefs.externalPlayerPath == null) { + saved.prefs.externalPlayerPath = '' + } +} diff --git a/src/renderer/lib/state.js b/src/renderer/lib/state.js index 9157eb7d80..a68eed3e7c 100644 --- a/src/renderer/lib/state.js +++ b/src/renderer/lib/state.js @@ -207,8 +207,6 @@ function load (cb) { onSavedState(err) return } - } else if (saved.prefs.externalPlayerPath == null) { - saved.prefs.externalPlayerPath = '' } onSavedState(null, saved) })