Skip to content

Commit

Permalink
Fix various typos (#880)
Browse files Browse the repository at this point in the history
* Fix various typos

* Fix various typos in tests

* Fix typos in `tests`

* Fix more typos

* Fix hasScalingMatrix test

Co-authored-by: JonnyWong16 <[email protected]>
  • Loading branch information
ReenigneArcher and JonnyWong16 authored Feb 27, 2022
1 parent 9a5170c commit 3917b33
Show file tree
Hide file tree
Showing 27 changed files with 97 additions and 97 deletions.
4 changes: 2 additions & 2 deletions plexapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
X_PLEX_CONTAINER_SIZE = CONFIG.get('plexapi.container_size', 100, int)
X_PLEX_ENABLE_FAST_CONNECT = CONFIG.get('plexapi.enable_fast_connect', False, bool)

# Plex Header Configuation
# Plex Header Configuration
X_PLEX_PROVIDES = CONFIG.get('header.provides', 'controller')
X_PLEX_PLATFORM = CONFIG.get('header.platform', CONFIG.get('header.platorm', uname()[0]))
X_PLEX_PLATFORM = CONFIG.get('header.platform', CONFIG.get('header.platform', uname()[0]))
X_PLEX_PLATFORM_VERSION = CONFIG.get('header.platform_version', uname()[2])
X_PLEX_PRODUCT = CONFIG.get('header.product', PROJECT)
X_PLEX_VERSION = CONFIG.get('header.version', VERSION)
Expand Down
2 changes: 1 addition & 1 deletion plexapi/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Audio(PlexPartialObject):
title (str): Name of the artist, album, or track (Jason Mraz, We Sing, Lucky, etc.).
titleSort (str): Title to use when sorting (defaults to title).
type (str): 'artist', 'album', or 'track'.
updatedAt (datatime): Datetime the item was updated.
updatedAt (datetime): Datetime the item was updated.
userRating (float): Rating of the item (0.0 - 10.0) equaling (0 stars - 5 stars).
viewCount (int): Count of times the item was played.
"""
Expand Down
18 changes: 9 additions & 9 deletions plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def fetchItems(self, ekey, cls=None, container_start=None, container_size=None,
Any XML attribute can be filtered when fetching results. Filtering is done before
the Python objects are built to help keep things speedy. For example, passing in
``viewCount=0`` will only return matching items where the view count is ``0``.
Note that case matters when specifying attributes. Attributes futher down in the XML
Note that case matters when specifying attributes. Attributes further down in the XML
tree can be filtered by *prepending* the attribute with each element tag ``Tag__``.
Examples:
Expand Down Expand Up @@ -228,12 +228,12 @@ def fetchItems(self, ekey, cls=None, container_start=None, container_size=None,
* ``__exists`` (*bool*): Value is or is not present in the attrs.
* ``__gt``: Value is greater than specified arg.
* ``__gte``: Value is greater than or equal to specified arg.
* ``__icontains``: Case insensative value contains specified arg.
* ``__iendswith``: Case insensative value ends with specified arg.
* ``__iexact``: Case insensative value matches specified arg.
* ``__icontains``: Case insensitive value contains specified arg.
* ``__iendswith``: Case insensitive value ends with specified arg.
* ``__iexact``: Case insensitive value matches specified arg.
* ``__in``: Value is in a specified list or tuple.
* ``__iregex``: Case insensative value matches the specified regular expression.
* ``__istartswith``: Case insensative value starts with specified arg.
* ``__iregex``: Case insensitive value matches the specified regular expression.
* ``__istartswith``: Case insensitive value starts with specified arg.
* ``__lt``: Value is less than specified arg.
* ``__lte``: Value is less than or equal to specified arg.
* ``__regex``: Value matches the specified regular expression.
Expand Down Expand Up @@ -392,7 +392,7 @@ def _getAttrValue(self, elem, attrstr, results=None):
# check were looking for the tag
if attr.lower() == 'etag':
return [elem.tag]
# loop through attrs so we can perform case-insensative match
# loop through attrs so we can perform case-insensitive match
for _attr, value in elem.attrib.items():
if attr.lower() == _attr.lower():
return [value]
Expand Down Expand Up @@ -455,7 +455,7 @@ def __iter__(self):
def __getattribute__(self, attr):
# Dragons inside.. :-/
value = super(PlexPartialObject, self).__getattribute__(attr)
# Check a few cases where we dont want to reload
# Check a few cases where we don't want to reload
if attr in _DONT_RELOAD_FOR_KEYS: return value
if attr in _DONT_OVERWRITE_SESSION_KEYS: return value
if attr in USER_DONT_RELOAD_FOR_KEYS: return value
Expand Down Expand Up @@ -709,7 +709,7 @@ def download(self, savepath=None, keep_original_name=False, **kwargs):
filename = part.file

if kwargs:
# So this seems to be a alot slower but allows transcode.
# So this seems to be a a lot slower but allows transcode.
download_url = self.getStreamURL(**kwargs)
else:
download_url = self._server.url('%s?download=1' % part.key)
Expand Down
10 changes: 5 additions & 5 deletions plexapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class PlexClient(PlexObject):
server (:class:`~plexapi.server.PlexServer`): PlexServer this client is connected to (optional).
data (ElementTree): Response from PlexServer used to build this object (optional).
initpath (str): Path used to generate data.
baseurl (str): HTTP URL to connect dirrectly to this client.
baseurl (str): HTTP URL to connect directly to this client.
identifier (str): The resource/machine identifier for the desired client.
May be necessary when connecting to a specific proxied client (optional).
token (str): X-Plex-Token used for authenication (optional).
token (str): X-Plex-Token used for authentication (optional).
session (:class:`~requests.Session`): requests.Session object if you want more control (optional).
timeout (int): timeout in seconds on initial connect to client (default config.TIMEOUT).
Expand All @@ -48,7 +48,7 @@ class PlexClient(PlexObject):
session (:class:`~requests.Session`): Session object used for connection.
state (str): Unknown
title (str): Name of this client (Johns iPhone, etc).
token (str): X-Plex-Token used for authenication
token (str): X-Plex-Token used for authentication
vendor (str): Unknown
version (str): Device version (4.6.1, etc).
_baseurl (str): HTTP address of the client.
Expand Down Expand Up @@ -210,8 +210,8 @@ def sendCommand(self, command, proxy=None, **params):
controller = command.split('/')[0]
headers = {'X-Plex-Target-Client-Identifier': self.machineIdentifier}
if controller not in self.protocolCapabilities:
log.debug('Client %s doesnt support %s controller.'
'What your trying might not work' % (self.title, controller))
log.debug("Client %s doesn't support %s controller."
"What your trying might not work" % (self.title, controller))

proxy = self._proxyThroughServer if proxy is None else proxy
query = self._server.query if proxy else self.query
Expand Down
4 changes: 2 additions & 2 deletions plexapi/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Collection(PlexPartialObject, AdvancedSettingsMixin, ArtMixin, PosterMixin
title (str): Name of the collection.
titleSort (str): Title to use when sorting (defaults to title).
type (str): 'collection'
updatedAt (datatime): Datetime the collection was updated.
updatedAt (datetime): Datetime the collection was updated.
userRating (float): Rating of the collection (0.0 - 10.0) equaling (0 stars - 5 stars).
"""
TAG = 'Directory'
Expand Down Expand Up @@ -219,7 +219,7 @@ def sortUpdate(self, sort=None):
Parameters:
sort (str): One of the following values:
"realease" (Order Collection by realease dates),
"release" (Order Collection by release dates),
"alpha" (Order Collection alphabetically),
"custom" (Custom collection order)
Expand Down
2 changes: 1 addition & 1 deletion plexapi/gdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class GDM:
"""Base class to discover GDM services.
Atrributes:
Attributes:
entries (List<dict>): List of server and/or client data discovered.
"""

Expand Down
8 changes: 4 additions & 4 deletions plexapi/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def recentlyAdded(self):
def search(self, title=None, libtype=None, **kwargs):
""" Searching within a library section is much more powerful. It seems certain
attributes on the media objects can be targeted to filter this search down
a bit, but I havent found the documentation for it.
a bit, but I haven't found the documentation for it.
Example: "studio=Comedy%20Central" or "year=1999" "title=Kung Fu" all work. Other items
such as actor=<id> seem to work, but require you already know the id of the actor.
Expand Down Expand Up @@ -396,7 +396,7 @@ def _loadData(self, data):
self.type = data.attrib.get('type')
self.updatedAt = utils.toDatetime(data.attrib.get('updatedAt'))
self.uuid = data.attrib.get('uuid')
# Private attrs as we dont want a reload.
# Private attrs as we don't want a reload.
self._filterTypes = None
self._fieldTypes = None
self._totalViewSize = None
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def search(self, title=None, sort=None, maxresults=None, libtype=None,
* See :func:`~plexapi.library.LibrarySection.listOperators` to get a list of all available operators.
* See :func:`~plexapi.library.LibrarySection.listFilterChoices` to get a list of all available filter values.
The following filter fields are just some examples of the possible filters. The list is not exaustive,
The following filter fields are just some examples of the possible filters. The list is not exhaustive,
and not all filters apply to all library types.
* **actor** (:class:`~plexapi.media.MediaTag`): Search for the name of an actor.
Expand Down Expand Up @@ -1334,7 +1334,7 @@ def search(self, title=None, sort=None, maxresults=None, libtype=None,
Some filters may be prefixed by the ``libtype`` separated by a ``.`` (e.g. ``show.collection``,
``episode.title``, ``artist.style``, ``album.genre``, ``track.userRating``, etc.). This should not be
confused with the ``libtype`` parameter. If no ``libtype`` prefix is provided, then the default library
type is assumed. For example, in a TV show library ``viewCout`` is assumed to be ``show.viewCount``.
type is assumed. For example, in a TV show library ``viewCount`` is assumed to be ``show.viewCount``.
If you want to filter using episode view count then you must specify ``episode.viewCount`` explicitly.
In addition, if the filter does not exist for the default library type it will fallback to the most
specific ``libtype`` available. For example, ``show.unwatched`` does not exists so it will fallback to
Expand Down
14 changes: 7 additions & 7 deletions plexapi/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Media(PlexObject):
<Photo_only_attributes>: The following attributes are only available for photos.
* aperture (str): The apeture used to take the photo.
* aperture (str): The aperture used to take the photo.
* exposure (str): The exposure used to take the photo.
* iso (int): The iso used to take the photo.
* lens (str): The lens used to take the photo.
Expand Down Expand Up @@ -93,7 +93,7 @@ def delete(self):
try:
return self._server.query(part, method=self._server._session.delete)
except BadRequest:
log.error("Failed to delete %s. This could be because you havn't allowed "
log.error("Failed to delete %s. This could be because you haven't allowed "
"items to be deleted" % part)
raise

Expand Down Expand Up @@ -283,8 +283,8 @@ class VideoStream(MediaPartStream):
duration (int): The duration of video stream in milliseconds.
frameRate (float): The frame rate of the video stream (ex: 23.976).
frameRateMode (str): The frame rate mode of the video stream.
hasScallingMatrix (bool): True if video stream has a scaling matrix.
height (int): The hight of the video stream in pixels (ex: 1080).
hasScalingMatrix (bool): True if video stream has a scaling matrix.
height (int): The height of the video stream in pixels (ex: 1080).
level (int): The codec encoding level of the video stream (ex: 41).
profile (str): The profile of the video stream (ex: asp).
pixelAspectRatio (str): The pixel aspect ratio of the video stream.
Expand Down Expand Up @@ -323,7 +323,7 @@ def _loadData(self, data):
self.duration = utils.cast(int, data.attrib.get('duration'))
self.frameRate = utils.cast(float, data.attrib.get('frameRate'))
self.frameRateMode = data.attrib.get('frameRateMode')
self.hasScallingMatrix = utils.cast(bool, data.attrib.get('hasScallingMatrix'))
self.hasScalingMatrix = utils.cast(bool, data.attrib.get('hasScalingMatrix'))
self.height = utils.cast(int, data.attrib.get('height'))
self.level = utils.cast(int, data.attrib.get('level'))
self.profile = data.attrib.get('profile')
Expand Down Expand Up @@ -400,7 +400,7 @@ class SubtitleStream(MediaPartStream):
container (str): The container of the subtitle stream.
forced (bool): True if this is a forced subtitle.
format (str): The format of the subtitle stream (ex: srt).
headerCommpression (str): The header compression of the subtitle stream.
headerCompression (str): The header compression of the subtitle stream.
transient (str): Unknown.
"""
TAG = 'Stream'
Expand Down Expand Up @@ -468,7 +468,7 @@ class TranscodeSession(PlexObject):
audioDecision (str): The transcode decision for the audio stream.
complete (bool): True if the transcode is complete.
container (str): The container of the transcoded media.
context (str): The context for the transcode sesson.
context (str): The context for the transcode session.
duration (int): The duration of the transcoded media in milliseconds.
height (int): The height of the transcoded media in pixels.
key (str): API URL (ex: /transcode/sessions/<id>).
Expand Down
18 changes: 9 additions & 9 deletions plexapi/myplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MyPlexAccount(PlexObject):
roles: (List<str>) Lit of account roles. Plexpass membership listed here.
scrobbleTypes (str): Description
secure (bool): Description
subscriptionActive (bool): True if your subsctiption is active.
subscriptionActive (bool): True if your subscription is active.
subscriptionFeatures: (List<str>) List of features allowed on your subscription.
subscriptionPlan (str): Name of subscription plan.
subscriptionStatus (str): String representation of `subscriptionActive`.
Expand Down Expand Up @@ -614,7 +614,7 @@ def syncItems(self, client=None, clientId=None):
clientId (str): an identifier of a client to query SyncItems for.
If both `client` and `clientId` provided the client would be preferred.
If neither `client` nor `clientId` provided the clientId would be set to current clients`s identifier.
If neither `client` nor `clientId` provided the clientId would be set to current clients's identifier.
"""
if client:
clientId = client.clientIdentifier
Expand All @@ -635,14 +635,14 @@ def sync(self, sync_item, client=None, clientId=None):
sync_item (:class:`~plexapi.sync.SyncItem`): prepared SyncItem object with all fields set.
If both `client` and `clientId` provided the client would be preferred.
If neither `client` nor `clientId` provided the clientId would be set to current clients`s identifier.
If neither `client` nor `clientId` provided the clientId would be set to current clients's identifier.
Returns:
:class:`~plexapi.sync.SyncItem`: an instance of created syncItem.
Raises:
:exc:`~plexapi.exceptions.BadRequest`: When client with provided clientId wasn`t found.
:exc:`~plexapi.exceptions.BadRequest`: Provided client doesn`t provides `sync-target`.
:exc:`~plexapi.exceptions.BadRequest`: When client with provided clientId wasn't found.
:exc:`~plexapi.exceptions.BadRequest`: Provided client doesn't provides `sync-target`.
"""
if not client and not clientId:
clientId = X_PLEX_IDENTIFIER
Expand All @@ -657,7 +657,7 @@ def sync(self, sync_item, client=None, clientId=None):
raise BadRequest('Unable to find client by clientId=%s', clientId)

if 'sync-target' not in client.provides:
raise BadRequest('Received client doesn`t provides sync-target')
raise BadRequest("Received client doesn't provides sync-target")

params = {
'SyncItem[title]': sync_item.title,
Expand Down Expand Up @@ -790,7 +790,7 @@ class MyPlexUser(PlexObject):
restricted (str): Unknown.
servers (List<:class:`~plexapi.myplex.<MyPlexServerShare`>)): Servers shared with the user.
thumb (str): Link to the users avatar.
title (str): Seems to be an aliad for username.
title (str): Seems to be an alias for username.
username (str): User's username.
"""
TAG = 'User'
Expand Down Expand Up @@ -1103,7 +1103,7 @@ def connect(
:exc:`~plexapi.exceptions.NotFound`: When unable to connect to any addresses for this resource.
"""
connections = self.preferred_connections(ssl, timeout, locations, schemes)
# Try connecting to all known resource connections in parellel, but
# Try connecting to all known resource connections in parallel, but
# only return the first server (in order) that provides a response.
cls = PlexServer if 'server' in self.provides else PlexClient
listargs = [[cls, url, self.accessToken, timeout] for url in connections]
Expand Down Expand Up @@ -1215,7 +1215,7 @@ def syncItems(self):
""" Returns an instance of :class:`~plexapi.sync.SyncList` for current device.
Raises:
:exc:`~plexapi.exceptions.BadRequest`: when the device doesn`t provides `sync-target`.
:exc:`~plexapi.exceptions.BadRequest`: when the device doesn't provides `sync-target`.
"""
if 'sync-target' not in self.provides:
raise BadRequest('Requested syncList for device which do not provides sync-target')
Expand Down
Loading

0 comments on commit 3917b33

Please sign in to comment.