mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 01:02:59 -07:00
Set default url and token in Plex object
This commit is contained in:
parent
1cc98e7f7d
commit
dd64a4a3d7
3 changed files with 6 additions and 4 deletions
|
@ -1598,7 +1598,7 @@ class Export(object):
|
||||||
else:
|
else:
|
||||||
plex_token = plexpy.CONFIG.PMS_TOKEN
|
plex_token = plexpy.CONFIG.PMS_TOKEN
|
||||||
|
|
||||||
plex = Plex(plexpy.CONFIG.PMS_URL, plex_token)
|
plex = Plex(token=plex_token)
|
||||||
|
|
||||||
if self.rating_key:
|
if self.rating_key:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -148,7 +148,7 @@ def has_library_type(section_type):
|
||||||
|
|
||||||
|
|
||||||
def get_collections(section_id=None):
|
def get_collections(section_id=None):
|
||||||
plex = Plex(plexpy.CONFIG.PMS_URL, session.get_session_user_token())
|
plex = Plex(token=session.get_session_user_token())
|
||||||
library = plex.get_library(section_id)
|
library = plex.get_library(section_id)
|
||||||
|
|
||||||
if library.type not in ('movie', 'show', 'artist'):
|
if library.type not in ('movie', 'show', 'artist'):
|
||||||
|
@ -245,7 +245,7 @@ def get_playlists(section_id=None, user_id=None):
|
||||||
if not plex_token:
|
if not plex_token:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
plex = Plex(plexpy.CONFIG.PMS_URL, plex_token)
|
plex = Plex(token=plex_token)
|
||||||
|
|
||||||
if user_id:
|
if user_id:
|
||||||
playlists = plex.plex.playlists()
|
playlists = plex.plex.playlists()
|
||||||
|
|
|
@ -52,7 +52,9 @@ else:
|
||||||
|
|
||||||
|
|
||||||
class Plex(object):
|
class Plex(object):
|
||||||
def __init__(self, url, token):
|
def __init__(self, url=None, token=None):
|
||||||
|
url = url or plexpy.CONFIG.PMS_URL
|
||||||
|
token = token or plexpy.CONFIG.PMS_TOKEN
|
||||||
self.plex = PlexServer(url, token)
|
self.plex = PlexServer(url, token)
|
||||||
|
|
||||||
def get_library(self, section_id):
|
def get_library(self, section_id):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue