From 801695fdd4f104d127453eae4d972e3299324b13 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 10 Sep 2019 17:56:56 +0200 Subject: [PATCH] Don't migrate PKC settings if we're dealing with a fresh PKC installation --- resources/lib/migration.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/lib/migration.py b/resources/lib/migration.py index 3c0adb42..6d496d2c 100644 --- a/resources/lib/migration.py +++ b/resources/lib/migration.py @@ -13,10 +13,14 @@ LOG = getLogger('PLEX.migration') def check_migration(): LOG.info('Checking whether we need to migrate something') last_migration = utils.settings('last_migrated_PKC_version') - if last_migration == v.ADDON_VERSION: + # Ensure later migration if user downgraded PKC! + utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION) + + if last_migration == '': + LOG.info('New, clean PKC installation - no migration necessary') + return + elif last_migration == v.ADDON_VERSION: LOG.info('Already migrated to PKC version %s' % v.ADDON_VERSION) - # Ensure later migration if user downgraded PKC! - utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION) return if not utils.compare_version(last_migration, '1.8.2'):