mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Fix failure to make session cache folder on startup
This commit is contained in:
parent
93e4853ea2
commit
12755970b7
2 changed files with 12 additions and 5 deletions
|
@ -165,9 +165,6 @@ def initialize(config_file):
|
|||
except OSError as e:
|
||||
pass
|
||||
|
||||
if not os.path.exists(session_metadata_folder):
|
||||
os.mkdir(session_metadata_folder)
|
||||
|
||||
# Initialize the database
|
||||
logger.info(u"Checking if the database upgrades are required...")
|
||||
try:
|
||||
|
|
|
@ -533,7 +533,12 @@ class PmsConnect(object):
|
|||
metadata = {}
|
||||
|
||||
if cache_key:
|
||||
in_file_path = os.path.join(plexpy.CONFIG.CACHE_DIR, 'session_metadata/metadata-sessionKey-%s.json' % cache_key)
|
||||
in_file_folder = os.path.join(plexpy.CONFIG.CACHE_DIR, 'session_metadata')
|
||||
in_file_path = os.path.join(in_file_folder, 'metadata-sessionKey-%s.json' % cache_key)
|
||||
|
||||
if not os.path.exists(in_file_folder):
|
||||
os.mkdir(in_file_folder)
|
||||
|
||||
try:
|
||||
with open(in_file_path, 'r') as inFile:
|
||||
metadata = json.load(inFile)
|
||||
|
@ -1179,7 +1184,12 @@ class PmsConnect(object):
|
|||
if cache_key:
|
||||
metadata['_cache_time'] = int(time.time())
|
||||
|
||||
out_file_path = os.path.join(plexpy.CONFIG.CACHE_DIR, 'session_metadata/metadata-sessionKey-%s.json' % cache_key)
|
||||
out_file_folder = os.path.join(plexpy.CONFIG.CACHE_DIR, 'session_metadata')
|
||||
out_file_path = os.path.join(out_file_folder, 'metadata-sessionKey-%s.json' % cache_key)
|
||||
|
||||
if not os.path.exists(out_file_folder):
|
||||
os.mkdir(out_file_folder)
|
||||
|
||||
try:
|
||||
with open(out_file_path, 'w') as outFile:
|
||||
json.dump(metadata, outFile)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue