Merge pull request #988 from croneter/optimize-migration

Don't migrate PKC settings if we're dealing with a clean new PKC installation
This commit is contained in:
croneter 2019-09-22 13:22:48 +02:00 committed by GitHub
commit 2e90a30dba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,10 +13,14 @@ LOG = getLogger('PLEX.migration')
def check_migration(): def check_migration():
LOG.info('Checking whether we need to migrate something') LOG.info('Checking whether we need to migrate something')
last_migration = utils.settings('last_migrated_PKC_version') last_migration = utils.settings('last_migrated_PKC_version')
if last_migration == v.ADDON_VERSION:
LOG.info('Already migrated to PKC version %s' % v.ADDON_VERSION)
# Ensure later migration if user downgraded PKC! # Ensure later migration if user downgraded PKC!
utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION) 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)
return return
if not utils.compare_version(last_migration, '1.8.2'): if not utils.compare_version(last_migration, '1.8.2'):