mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 17:22:56 -07:00
Add mobile device last seen
This commit is contained in:
parent
019787b32d
commit
ecd0a199f1
5 changed files with 61 additions and 22 deletions
|
@ -13,6 +13,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with PlexPy. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import time
|
||||
|
||||
import plexpy
|
||||
import database
|
||||
import helpers
|
||||
|
@ -121,6 +123,19 @@ def delete_mobile_device(mobile_device_id=None):
|
|||
return False
|
||||
|
||||
|
||||
def set_last_seen(device_token=None):
|
||||
db = database.MonitorDatabase()
|
||||
|
||||
last_seen = int(time.time())
|
||||
|
||||
try:
|
||||
result = db.action('UPDATE mobile_devices SET last_seen = ? WHERE device_token = ?',
|
||||
args=[last_seen, device_token])
|
||||
except Exception as e:
|
||||
logger.warn(u"PlexPy MobileApp :: Failed to set last_seen time for device: %s." % e)
|
||||
return
|
||||
|
||||
|
||||
def blacklist_logger():
|
||||
devices = get_mobile_devices()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue