Skip to content

Commit

Permalink
Fix: Inherit session when creating internal PlexServer objects (#1069)
Browse files Browse the repository at this point in the history
* Make myPlexAccount inherit session

* Pass session to _toOnlineMetadata PlexServer
  • Loading branch information
glensc authored Dec 21, 2022
1 parent 73f8a8b commit b056e9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plexapi/myplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ def _toOnlineMetadata(self, objs):
""" Convert a list of media objects to online metadata objects. """
# TODO: Add proper support for metadata.provider.plex.tv
# Temporary workaround to allow reloading and browsing of online media objects
server = PlexServer(self.METADATA, self._token)
server = PlexServer(self.METADATA, self._token, session=self._session)

if not isinstance(objs, list):
objs = [objs]
Expand Down
2 changes: 1 addition & 1 deletion plexapi/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def myPlexAccount(self):
"""
if self._myPlexAccount is None:
from plexapi.myplex import MyPlexAccount
self._myPlexAccount = MyPlexAccount(token=self._token)
self._myPlexAccount = MyPlexAccount(token=self._token, session=self._session)
return self._myPlexAccount

def _myPlexClientPorts(self):
Expand Down

0 comments on commit b056e9d

Please sign in to comment.