1515from plexapi .playlist import Playlist
1616from plexapi .playqueue import PlayQueue
1717from plexapi .settings import Settings
18- from plexapi .utils import cast
18+ from plexapi .utils import cast , deprecated
1919from requests .status_codes import _codes as codes
2020
2121# Need these imports to populate utils.PLEXOBJECTS
@@ -375,7 +375,11 @@ def downloadLogs(self, savepath=None, unpack=False):
375375 filepath = utils .download (url , self ._token , None , savepath , self ._session , unpack = unpack )
376376 return filepath
377377
378+ @deprecated ('use "checkForUpdate" instead' )
378379 def check_for_update (self , force = True , download = False ):
380+ return self .checkForUpdate ()
381+
382+ def checkForUpdate (self , force = True , download = False ):
379383 """ Returns a :class:`~plexapi.base.Release` object containing release info.
380384
381385 Parameters:
@@ -391,15 +395,15 @@ def check_for_update(self, force=True, download=False):
391395
392396 def isLatest (self ):
393397 """ Check if the installed version of PMS is the latest. """
394- release = self .check_for_update (force = True )
398+ release = self .checkForUpdate (force = True )
395399 return release is None
396400
397401 def installUpdate (self ):
398402 """ Install the newest version of Plex Media Server. """
399403 # We can add this but dunno how useful this is since it sometimes
400404 # requires user action using a gui.
401405 part = '/updater/apply'
402- release = self .check_for_update (force = True , download = True )
406+ release = self .checkForUpdate (force = True , download = True )
403407 if release and release .version != self .version :
404408 # figure out what method this is..
405409 return self .query (part , method = self ._session .put )
@@ -788,6 +792,20 @@ def _loadData(self, data):
788792 self .uuid = data .attrib .get ('uuid' )
789793
790794
795+ @utils .registerPlexObject
796+ class Release (PlexObject ):
797+ TAG = 'Release'
798+ key = '/updater/status'
799+
800+ def _loadData (self , data ):
801+ self .download_key = data .attrib .get ('key' )
802+ self .version = data .attrib .get ('version' )
803+ self .added = data .attrib .get ('added' )
804+ self .fixed = data .attrib .get ('fixed' )
805+ self .downloadURL = data .attrib .get ('downloadURL' )
806+ self .state = data .attrib .get ('state' )
807+
808+
791809class SystemAccount (PlexObject ):
792810 """ Represents a single system account.
793811
0 commit comments