diff --git a/plexapi/base.py b/plexapi/base.py index adc981a88..a7fa82eee 100644 --- a/plexapi/base.py +++ b/plexapi/base.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Generic, Iterable, List, Optional, TypeVar, Union import weakref from functools import cached_property -from urllib.parse import urlencode +from urllib.parse import parse_qsl, urlencode, urlparse from xml.etree import ElementTree from xml.etree.ElementTree import Element @@ -391,10 +391,9 @@ def reload(self, key=None, **kwargs): Parameters: key (string, optional): Override the key to reload. - **kwargs (dict): A dictionary of XML include parameters to exclude or override. - All parameters are included by default with the option to override each parameter - or disable each parameter individually by setting it to False or 0. + **kwargs (dict): A dictionary of XML include parameters to include/exclude or override. See :class:`~plexapi.base.PlexPartialObject` for all the available include parameters. + Set parameter to True to include and False to exclude. Example: @@ -600,7 +599,11 @@ def isFullObject(self): search result for a movie often only contain a portion of the attributes a full object (main url) for that movie would contain. """ - return not self.key or (self._details_key or self.key) == self._initpath + parsed_key = urlparse(self._details_key or self.key) + parsed_initpath = urlparse(self._initpath) + query_key = set(parse_qsl(parsed_key.query)) + query_init = set(parse_qsl(parsed_initpath.query)) + return not self.key or (parsed_key.path == parsed_initpath.path and query_key <= query_init) def isPartialObject(self): """ Returns True if this is not a full object. """ diff --git a/tests/test_video.py b/tests/test_video.py index b25fe4b30..a51f206e8 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -323,10 +323,12 @@ def test_video_Movie_getStreamURL(movie, account): def test_video_Movie_isFullObject_and_reload(plex): movie = plex.library.section("Movies").get("Sita Sings the Blues") assert movie.isFullObject() is False - movie.reload(checkFiles=False) + movie.reload(includeChapters=False) assert movie.isFullObject() is False movie.reload() assert movie.isFullObject() is True + movie.reload(includeExtras=True) + assert movie.isFullObject() is True movie_via_search = plex.library.search(movie.title)[0] assert movie_via_search.isFullObject() is False movie_via_search.reload()