mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Fix current activity bug if user has no friendly name.
This commit is contained in:
parent
64d9b95de9
commit
4936ad0476
1 changed files with 8 additions and 5 deletions
|
@ -911,12 +911,15 @@ class PlexWatch(object):
|
||||||
|
|
||||||
def get_user_friendly_name(self, user=None):
|
def get_user_friendly_name(self, user=None):
|
||||||
if user:
|
if user:
|
||||||
myDB = db.DBConnection()
|
try:
|
||||||
|
myDB = db.DBConnection()
|
||||||
|
query = 'select friendly_name FROM plexpy_users WHERE username = "%s"' % user
|
||||||
|
result = myDB.select_single(query)
|
||||||
|
return result
|
||||||
|
except:
|
||||||
|
return user
|
||||||
|
|
||||||
query = 'select friendly_name FROM plexpy_users WHERE username = "%s"' % user
|
return None
|
||||||
result = myDB.select_single(query)
|
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
||||||
# Taken from:
|
# Taken from:
|
||||||
# https://stackoverflow.com/questions/18066269/group-by-and-aggregate-the-values-of-a-list-of-dictionaries-in-python
|
# https://stackoverflow.com/questions/18066269/group-by-and-aggregate-the-values-of-a-list-of-dictionaries-in-python
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue