diff --git a/plexapi/base.py b/plexapi/base.py index 92c00bf92..4fd37a530 100644 --- a/plexapi/base.py +++ b/plexapi/base.py @@ -662,17 +662,3 @@ def updateTimeline(self, time, state='stopped', duration=None): key %= (self.ratingKey, self.key, time, state, durationStr) self._server.query(key) self.reload() - - -@utils.registerPlexObject -class Release(PlexObject): - TAG = 'Release' - key = '/updater/status' - - def _loadData(self, data): - self.download_key = data.attrib.get('key') - self.version = data.attrib.get('version') - self.added = data.attrib.get('added') - self.fixed = data.attrib.get('fixed') - self.downloadURL = data.attrib.get('downloadURL') - self.state = data.attrib.get('state') diff --git a/plexapi/server.py b/plexapi/server.py index 42c92fdca..4337b911f 100644 --- a/plexapi/server.py +++ b/plexapi/server.py @@ -15,7 +15,7 @@ from plexapi.playlist import Playlist from plexapi.playqueue import PlayQueue from plexapi.settings import Settings -from plexapi.utils import cast +from plexapi.utils import cast, deprecated from requests.status_codes import _codes as codes # Need these imports to populate utils.PLEXOBJECTS @@ -374,7 +374,11 @@ def downloadLogs(self, savepath=None, unpack=False): filepath = utils.download(url, self._token, None, savepath, self._session, unpack=unpack) return filepath + @deprecated('use "checkForUpdate" instead') def check_for_update(self, force=True, download=False): + return self.checkForUpdate() + + def checkForUpdate(self, force=True, download=False): """ Returns a :class:`~plexapi.base.Release` object containing release info. Parameters: @@ -390,7 +394,7 @@ def check_for_update(self, force=True, download=False): def isLatest(self): """ Check if the installed version of PMS is the latest. """ - release = self.check_for_update(force=True) + release = self.checkForUpdate(force=True) return release is None def installUpdate(self): @@ -398,7 +402,7 @@ def installUpdate(self): # We can add this but dunno how useful this is since it sometimes # requires user action using a gui. part = '/updater/apply' - release = self.check_for_update(force=True, download=True) + release = self.checkForUpdate(force=True, download=True) if release and release.version != self.version: # figure out what method this is.. return self.query(part, method=self._session.put) @@ -787,6 +791,20 @@ def _loadData(self, data): self.uuid = data.attrib.get('uuid') +@utils.registerPlexObject +class Release(PlexObject): + TAG = 'Release' + key = '/updater/status' + + def _loadData(self, data): + self.download_key = data.attrib.get('key') + self.version = data.attrib.get('version') + self.added = data.attrib.get('added') + self.fixed = data.attrib.get('fixed') + self.downloadURL = data.attrib.get('downloadURL') + self.state = data.attrib.get('state') + + class SystemAccount(PlexObject): """ Represents a single system account.