Only users with libraries shared can be selected.

Should resolve #125
This commit is contained in:
Blacktwin 2019-01-06 09:03:47 -05:00
parent ca19d3d6b4
commit 11715e1e6e

View File

@ -45,14 +45,13 @@ sess.verify = False # '/path/to/certfile'
if sess.verify is False:
# Disable the warning that the request is insecure, we know that...
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=sess)
sections_lst = [x.title for x in plex.library.sections()]
admin = {plex.myPlexAccount().id: plex.myPlexAccount().title}
users_dict = {x.id: x.title for x in plex.myPlexAccount().users()}
users_dict = {x.id: x.title for x in plex.myPlexAccount().users() if x.servers}
users_dict.update(admin)
today = time.mktime(datetime.datetime.today().timetuple())