diff --git a/plexapi/audio.py b/plexapi/audio.py index 7c3327824..8a0e62b97 100644 --- a/plexapi/audio.py +++ b/plexapi/audio.py @@ -3,7 +3,7 @@ from pathlib import Path from urllib.parse import quote_plus -from typing_extensions import Self +from typing import TypeVar from plexapi import media, utils from plexapi.base import Playable, PlexPartialObject, PlexHistory, PlexSession @@ -16,6 +16,9 @@ from plexapi.playlist import Playlist +Self = TypeVar("Self", bound="Audio") + + class Audio(PlexPartialObject, PlayedUnplayedMixin): """ Base class for all audio objects including :class:`~plexapi.audio.Artist`, :class:`~plexapi.audio.Album`, and :class:`~plexapi.audio.Track`. @@ -130,7 +133,7 @@ def sync(self, bitrate, client=None, clientId=None, limit=None, title=None): return myplex.sync(sync_item, client=client, clientId=clientId) def sonicallySimilar( - self, + self: Self, limit: int = 30, maxDistance: float = 0.25, **kwargs, @@ -142,7 +145,6 @@ def sonicallySimilar( maxDistance (float): maximum distance between tracks, 0.0 - 1.0. **kwargs: Additional options passed into :func:`~plexapi.base.PlexObject.fetchItems`. - Returns: List[:class:`~plexapi.audio.Audio`]: list of sonically similar audio items. """