mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 17:22:56 -07:00
Remove unicode strings
This commit is contained in:
parent
1c18e72539
commit
c279057f91
28 changed files with 834 additions and 847 deletions
|
@ -64,13 +64,13 @@ def add_mobile_device(device_id=None, device_name=None, device_token=None, frien
|
|||
try:
|
||||
result = db.upsert(table_name='mobile_devices', key_dict=keys, value_dict=values)
|
||||
except Exception as e:
|
||||
logger.warn(u"Tautulli MobileApp :: Failed to register mobile device in the database: %s." % e)
|
||||
logger.warn("Tautulli MobileApp :: Failed to register mobile device in the database: %s." % e)
|
||||
return
|
||||
|
||||
if result == 'insert':
|
||||
logger.info(u"Tautulli MobileApp :: Registered mobile device '%s' in the database." % device_name)
|
||||
logger.info("Tautulli MobileApp :: Registered mobile device '%s' in the database." % device_name)
|
||||
else:
|
||||
logger.debug(u"Tautulli MobileApp :: Re-registered mobile device '%s' in the database." % device_name)
|
||||
logger.debug("Tautulli MobileApp :: Re-registered mobile device '%s' in the database." % device_name)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -79,7 +79,7 @@ def get_mobile_device_config(mobile_device_id=None):
|
|||
if str(mobile_device_id).isdigit():
|
||||
mobile_device_id = int(mobile_device_id)
|
||||
else:
|
||||
logger.error(u"Tautulli MobileApp :: Unable to retrieve mobile device config: invalid mobile_device_id %s." % mobile_device_id)
|
||||
logger.error("Tautulli MobileApp :: Unable to retrieve mobile device config: invalid mobile_device_id %s." % mobile_device_id)
|
||||
return None
|
||||
|
||||
db = database.MonitorDatabase()
|
||||
|
@ -93,7 +93,7 @@ def set_mobile_device_config(mobile_device_id=None, **kwargs):
|
|||
if str(mobile_device_id).isdigit():
|
||||
mobile_device_id = int(mobile_device_id)
|
||||
else:
|
||||
logger.error(u"Tautulli MobileApp :: Unable to set exisiting mobile device: invalid mobile_device_id %s." % mobile_device_id)
|
||||
logger.error("Tautulli MobileApp :: Unable to set exisiting mobile device: invalid mobile_device_id %s." % mobile_device_id)
|
||||
return False
|
||||
|
||||
keys = {'id': mobile_device_id}
|
||||
|
@ -105,10 +105,10 @@ def set_mobile_device_config(mobile_device_id=None, **kwargs):
|
|||
db = database.MonitorDatabase()
|
||||
try:
|
||||
db.upsert(table_name='mobile_devices', key_dict=keys, value_dict=values)
|
||||
logger.info(u"Tautulli MobileApp :: Updated mobile device agent: mobile_device_id %s." % mobile_device_id)
|
||||
logger.info("Tautulli MobileApp :: Updated mobile device agent: mobile_device_id %s." % mobile_device_id)
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.warn(u"Tautulli MobileApp :: Unable to update mobile device: %s." % e)
|
||||
logger.warn("Tautulli MobileApp :: Unable to update mobile device: %s." % e)
|
||||
return False
|
||||
|
||||
|
||||
|
@ -116,7 +116,7 @@ def delete_mobile_device(mobile_device_id=None):
|
|||
db = database.MonitorDatabase()
|
||||
|
||||
if mobile_device_id:
|
||||
logger.debug(u"Tautulli MobileApp :: Deleting device_id %s from the database." % mobile_device_id)
|
||||
logger.debug("Tautulli MobileApp :: Deleting device_id %s from the database." % mobile_device_id)
|
||||
result = db.action('DELETE FROM mobile_devices WHERE id = ?', args=[mobile_device_id])
|
||||
return True
|
||||
else:
|
||||
|
@ -132,7 +132,7 @@ def set_last_seen(device_token=None):
|
|||
result = db.action('UPDATE mobile_devices SET last_seen = ? WHERE device_token = ?',
|
||||
args=[last_seen, device_token])
|
||||
except Exception as e:
|
||||
logger.warn(u"Tautulli MobileApp :: Failed to set last_seen time for device: %s." % e)
|
||||
logger.warn("Tautulli MobileApp :: Failed to set last_seen time for device: %s." % e)
|
||||
return
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue