mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Only update the database sessions every 60 seconds while playing
This commit is contained in:
parent
9b4536f132
commit
157af84226
5 changed files with 21 additions and 8 deletions
|
@ -542,7 +542,7 @@ class PmsConnect(object):
|
|||
|
||||
if metadata:
|
||||
_cache_time = metadata.pop('_cache_time', 0)
|
||||
# Return cached metadata if less than 30 minutes ago
|
||||
# Return cached metadata if less than METADATA_CACHE_SECONDS ago
|
||||
if int(time.time()) - _cache_time <= plexpy.CONFIG.METADATA_CACHE_SECONDS:
|
||||
return metadata
|
||||
|
||||
|
@ -1155,9 +1155,9 @@ class PmsConnect(object):
|
|||
metadata['media_info'] = medias
|
||||
|
||||
if metadata:
|
||||
metadata['_cache_time'] = int(time.time())
|
||||
|
||||
if cache_key:
|
||||
metadata['_cache_time'] = int(time.time())
|
||||
|
||||
out_file_path = os.path.join(plexpy.CONFIG.CACHE_DIR, 'metadata-sessionKey-%s.json' % cache_key)
|
||||
try:
|
||||
with open(out_file_path, 'w') as outFile:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue