diff --git a/.gitignore b/.gitignore index 39439fb46..6b7703a01 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ syntax: glob .coverage .idea/ .Python +.vscode bin/ build config.ini diff --git a/plexapi/base.py b/plexapi/base.py index b8bfbd681..2f16c292d 100644 --- a/plexapi/base.py +++ b/plexapi/base.py @@ -334,9 +334,9 @@ def isFullObject(self): """ Retruns True if this is already a full object. A full object means all attributes were populated from the api path representing only this item. For example, the search result for a movie often only contain a portion of the attributes a full - object (main url) for that movie contain. + object (main url) for that movie would contain. """ - return not self.key or self.key == self._initpath + return not self.key or (self._details_key or self.key) == self._initpath def isPartialObject(self): """ Returns True if this is not a full object. """ @@ -612,14 +612,6 @@ def _loadData(self, data): self.playlistItemID = utils.cast(int, data.attrib.get('playlistItemID')) # playlist self.playQueueItemID = utils.cast(int, data.attrib.get('playQueueItemID')) # playqueue - def isFullObject(self): - """ Retruns True if this is already a full object. A full object means all attributes - were populated from the api path representing only this item. For example, the - search result for a movie often only contain a portion of the attributes a full - object (main url) for that movie contain. - """ - return self._details_key == self._initpath or not self.key - def getStreamURL(self, **params): """ Returns a stream url that may be used by external applications such as VLC. diff --git a/plexapi/library.py b/plexapi/library.py index 4a7c4b848..50280dc94 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -1491,7 +1491,7 @@ def modeUpdate(self, mode=None): collection = 'plexapi.library.Collections' collection.updateMode(mode="hide") """ - mode_dict = {'default': '-2', + mode_dict = {'default': '-1', 'hide': '0', 'hideItems': '1', 'showItems': '2'} diff --git a/tests/test_library.py b/tests/test_library.py index fabc3ff7a..b576442ce 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -242,7 +242,7 @@ def test_library_editAdvanced_default(movies): def test_library_Collection_modeUpdate(collection): - mode_dict = {"default": "-2", "hide": "0", "hideItems": "1", "showItems": "2"} + mode_dict = {"default": "-1", "hide": "0", "hideItems": "1", "showItems": "2"} for key, value in mode_dict.items(): collection.modeUpdate(key) collection.reload() @@ -269,7 +269,7 @@ def test_library_Colletion_edit(collection): for field in collection.fields: if field.name == 'titleSort': assert collection.titleSort == 'New Title Sort' - assert field.locked == True + assert field.locked is True collection.edit(**{'titleSort.value': collectionTitleSort, 'titleSort.locked': 0}) diff --git a/tests/test_video.py b/tests/test_video.py index 21ca259b2..22cba4e91 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -909,7 +909,7 @@ def test_video_edits_locked(movie, episode): for field in movie.fields: if field.name == 'titleSort': assert movie.titleSort == 'New Title Sort' - assert field.locked == True + assert field.locked is True movie.edit(**{'titleSort.value': movieTitleSort, 'titleSort.locked': 0}) episodeTitleSort = episode.titleSort @@ -918,7 +918,7 @@ def test_video_edits_locked(movie, episode): for field in episode.fields: if field.name == 'titleSort': assert episode.titleSort == 'New Title Sort' - assert field.locked == True + assert field.locked is True episode.edit(**{'titleSort.value': episodeTitleSort, 'titleSort.locked': 0})