File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import xbmc
21import xbmcaddon
2+ import xbmcvfs
33
44import os
55from datetime import timedelta
1313monthsBeforeArtsExpiration = 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' ))
17- ART_AVAILABILITY_CACHE_FILE = xbmc .translatePath (os .path .join (addonUserDataFolder , 'requests_cache_arts' ))
16+ addonUserDataFolder = xbmcvfs .translatePath (__addon__ .getAddonInfo ('profile' ))
17+ ART_AVAILABILITY_CACHE_FILE = xbmcvfs .translatePath (os .path .join (addonUserDataFolder , 'requests_cache_arts' ))
1818
1919cached_requests = requests_cache .core .CachedSession (ART_AVAILABILITY_CACHE_FILE , backend = 'sqlite' ,
2020 expire_after = timedelta (weeks = 4 * monthsBeforeArtsExpiration ),
Original file line number Diff line number Diff line change 33import shlex
44import subprocess
55
6- import xbmc
76import xbmcaddon
87import xbmcplugin
8+ import xbmcvfs
99
1010import requests
1111import requests_cache
1616minutesBeforeGamesListsExpiration = int (__addon__ .getSetting ("games-expire-after-minutes" )) # Default is 3 days
1717
1818# define the cache file to reside in the ..\Kodi\userdata\addon_data\(your addon)
19- addonUserDataFolder = xbmc .translatePath (__addon__ .getAddonInfo ('profile' ))
20- STEAM_GAMES_CACHE_FILE = xbmc .translatePath (os .path .join (addonUserDataFolder , 'requests_cache_games' ))
19+ addonUserDataFolder = xbmcvfs .translatePath (__addon__ .getAddonInfo ('profile' ))
20+ STEAM_GAMES_CACHE_FILE = xbmcvfs .translatePath (os .path .join (addonUserDataFolder , 'requests_cache_games' ))
2121
2222# cache expires after: 86400=1 day 604800=7 days
2323cached_requests = requests_cache .CachedSession (STEAM_GAMES_CACHE_FILE , backend = 'sqlite' ,
@@ -120,4 +120,4 @@ def delete_cache():
120120 log ('Failed to delete & recreate cache' )
121121 cached_requests .cache .responses = requests_cache .backends .storage .dbdict .DbPickleDict (STEAM_GAMES_CACHE_FILE + ".sqlite" , 'responses' , fast_save = True )
122122 cached_requests .cache .keys_map = requests_cache .backends .storage .dbdict .DbDict (STEAM_GAMES_CACHE_FILE + ".sqlite" , 'urls' )
123-
123+
You can’t perform that action at this time.
0 commit comments