Skip to content

Commit

Permalink
Merge pull request #35 from aanderse/kodi-fix
Browse files Browse the repository at this point in the history
bump to version 0.9.0
  • Loading branch information
aanderse authored Jun 6, 2023
2 parents 6082943 + bebbc96 commit 502b92d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.program.steam.library" name="Steam Library" version="0.8.1" provider-name="aanderse">
<addon id="plugin.program.steam.library" name="Steam Library" version="0.9.0" provider-name="aanderse">
<requires>
<import addon="xbmc.python" version="3.0.0" />
<import addon="script.module.requests" version="2.22.0" />
Expand Down Expand Up @@ -45,6 +45,8 @@
- Offline support of the game lists, with a caching mechanism of the Steam API responses
v0.8.0 (2021-03-12)
- ported to kodi 19.x
v0.9.0 (2023-06-05)
- ported to kodi 20.x
</news>
<assets>
<icon>icon.png</icon>
Expand Down
6 changes: 3 additions & 3 deletions resources/arts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import xbmc
import xbmcaddon
import xbmcvfs

import os
from datetime import timedelta
Expand All @@ -13,8 +13,8 @@
monthsBeforeArtsExpiration = int(__addon__.getSetting("arts-expire-after-months")) # Default is 2 months

# define the cache file to reside in the ..\Kodi\userdata\addon_data\(your addon)
addonUserDataFolder = xbmc.translatePath(__addon__.getAddonInfo('profile'))
ART_AVAILABILITY_CACHE_FILE = xbmc.translatePath(os.path.join(addonUserDataFolder, 'requests_cache_arts'))
addonUserDataFolder = xbmcvfs.translatePath(__addon__.getAddonInfo('profile'))
ART_AVAILABILITY_CACHE_FILE = xbmcvfs.translatePath(os.path.join(addonUserDataFolder, 'requests_cache_arts'))

cached_requests = requests_cache.core.CachedSession(ART_AVAILABILITY_CACHE_FILE, backend='sqlite',
expire_after= timedelta(weeks=4*monthsBeforeArtsExpiration),
Expand Down
8 changes: 4 additions & 4 deletions resources/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import shlex
import subprocess

import xbmc
import xbmcaddon
import xbmcplugin
import xbmcvfs

import requests
import requests_cache
Expand All @@ -16,8 +16,8 @@
minutesBeforeGamesListsExpiration = int(__addon__.getSetting("games-expire-after-minutes")) # Default is 3 days

# define the cache file to reside in the ..\Kodi\userdata\addon_data\(your addon)
addonUserDataFolder = xbmc.translatePath(__addon__.getAddonInfo('profile'))
STEAM_GAMES_CACHE_FILE = xbmc.translatePath(os.path.join(addonUserDataFolder, 'requests_cache_games'))
addonUserDataFolder = xbmcvfs.translatePath(__addon__.getAddonInfo('profile'))
STEAM_GAMES_CACHE_FILE = xbmcvfs.translatePath(os.path.join(addonUserDataFolder, 'requests_cache_games'))

# cache expires after: 86400=1 day 604800=7 days
cached_requests = requests_cache.CachedSession(STEAM_GAMES_CACHE_FILE, backend='sqlite',
Expand Down Expand Up @@ -120,4 +120,4 @@ def delete_cache():
log('Failed to delete & recreate cache')
cached_requests.cache.responses = requests_cache.backends.storage.dbdict.DbPickleDict(STEAM_GAMES_CACHE_FILE + ".sqlite", 'responses', fast_save=True)
cached_requests.cache.keys_map = requests_cache.backends.storage.dbdict.DbDict(STEAM_GAMES_CACHE_FILE + ".sqlite", 'urls')


0 comments on commit 502b92d

Please sign in to comment.