Merge branch 'nightly' into python3
# Conflicts: # plexpy/database.py # plexpy/version.py
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
from __future__ import unicode_literals
|
||||
from future.builtins import str
|
||||
|
||||
import time
|
||||
import threading
|
||||
|
||||
import plexpy
|
||||
if plexpy.PYTHON2:
|
||||
@@ -32,6 +32,24 @@ else:
|
||||
|
||||
|
||||
TEMP_DEVICE_TOKEN = None
|
||||
INVALIDATE_TIMER = None
|
||||
|
||||
|
||||
def set_temp_device_token(token=None):
|
||||
global TEMP_DEVICE_TOKEN
|
||||
TEMP_DEVICE_TOKEN = token
|
||||
|
||||
if TEMP_DEVICE_TOKEN is not None:
|
||||
global INVALIDATE_TIMER
|
||||
if INVALIDATE_TIMER:
|
||||
INVALIDATE_TIMER.cancel()
|
||||
invalidate_time = 5 * 60 # 5 minutes
|
||||
INVALIDATE_TIMER = threading.Timer(invalidate_time, set_temp_device_token, args=[None])
|
||||
INVALIDATE_TIMER.start()
|
||||
|
||||
|
||||
def get_temp_device_token():
|
||||
return TEMP_DEVICE_TOKEN
|
||||
|
||||
|
||||
def get_mobile_devices(device_id=None, device_token=None):
|
||||
|
Reference in New Issue
Block a user