Skip to content

Commit 82b7e98

Browse files
authored
Merge pull request #28 from AmineI/AmineI_master
Follow Kodi recommendations around obtaining settings and addon paths
2 parents cda1766 + e71e0f3 commit 82b7e98

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

resources/arts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
monthsBeforeArtsExpiration = int(__addon__.getSetting("arts-expire-after-months")) # Default is 2 months
1414

1515
# define the cache file to reside in the ..\Kodi\userdata\addon_data\(your addon)
16-
addonUserDataFolder = xbmc.translatePath(__addon__.getAddonInfo('profile'))
16+
addonUserDataFolder = xbmc.translatePath(__addon__.getAddonInfo('profile')).decode('utf-8')
1717
ART_AVAILABILITY_CACHE_FILE = xbmc.translatePath(os.path.join(addonUserDataFolder, 'requests_cache_arts'))
1818

1919
cached_requests = requests_cache.core.CachedSession(ART_AVAILABILITY_CACHE_FILE, backend='sqlite',

resources/steam.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
from util import log
1414

1515
__addon__ = xbmcaddon.Addon()
16+
minutesBeforeGamesListsExpiration = int(__addon__.getSetting("games-expire-after-minutes")) # Default is 3 days
17+
1618
# define the cache file to reside in the ..\Kodi\userdata\addon_data\(your addon)
17-
addonUserDataFolder = xbmc.translatePath(__addon__.getAddonInfo('profile'))
19+
addonUserDataFolder = xbmc.translatePath(__addon__.getAddonInfo('profile')).decode('utf-8')
1820
STEAM_GAMES_CACHE_FILE = xbmc.translatePath(os.path.join(addonUserDataFolder, 'requests_cache_games'))
19-
minutesBeforeGamesListsExpiration = int(xbmcplugin.getSetting(int(sys.argv[1]), "games-expire-after-minutes")) # Default is 3 days
2021

2122
# cache expires after: 86400=1 day 604800=7 days
2223
cached_requests = requests_cache.core.CachedSession(STEAM_GAMES_CACHE_FILE, backend='sqlite',

0 commit comments

Comments
 (0)