mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
More template filters for Libraries, Users, and Sync
This commit is contained in:
parent
4f8a5211f8
commit
89694b5069
13 changed files with 74 additions and 43 deletions
|
@ -562,4 +562,18 @@ def uploadToImgur(imgPath, imgTitle=''):
|
|||
except (urllib2.HTTPError, urllib2.URLError) as e:
|
||||
logger.warn(u"PlexPy Helpers :: Unable to upload image to Imgur: %s" % e)
|
||||
|
||||
return img_url
|
||||
return img_url
|
||||
|
||||
def filter_datatable_session(list_of_dicts):
|
||||
import cherrypy
|
||||
from plexpy.webauth import SESSION_KEY
|
||||
|
||||
_cp_session = cherrypy.session.get(SESSION_KEY)
|
||||
_session = {}
|
||||
_session['username'], _session['user_id'], _session['user_group'], _session['expiry'] = \
|
||||
_cp_session if _cp_session else (None, None, None, None)
|
||||
|
||||
if _session['user_id']:
|
||||
return [d for d in list_of_dicts if str(d.get('user_id')) == str(_session['user_id'])]
|
||||
else:
|
||||
return list_of_dicts
|
Loading…
Add table
Add a link
Reference in a new issue