Skip to content

Commit f2ffa26

Browse files
committed
Implement addon upgrade mechanism
1 parent 299c53c commit f2ffa26

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

addon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.program.steam.library" name="Steam Library" version="0.8.0" provider-name="aanderse">
2+
<addon id="plugin.program.steam.library" name="Steam Library" version="0.8.1" provider-name="aanderse">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0" />
55
<import addon="script.module.requests" version="2.18.4" />

resources/main.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,22 @@ def main():
232232
# first time run, store version
233233
__addon__.setSetting('version', __addon__.getAddonInfo('version'))
234234

235+
else:
236+
previous_version= __addon__.getSetting('version').split(".")
237+
previous_version= list(map(int, previous_version))
238+
239+
new_version= __addon__.getSetting('version').split(".")
240+
new_version= list(map(int,new_version))
241+
242+
if previous_version[0] == 0 & previous_version[1] < 8:
243+
#Starting with 0.8.0, the cache encoding changed and previous caches needs to be reset.
244+
delete_cache()
245+
246+
# Insert version upgrade mechanisms here before the following call
247+
248+
__addon__.setSetting('version', __addon__.getAddonInfo('version'))
249+
250+
235251
# prompt the user to configure the plugin with their steam details
236252
if not all_required_credentials_available():
237253
__addon__.openSettings()

0 commit comments

Comments
 (0)