Skip to content

Commit

Permalink
Add type hinting for method
Browse files Browse the repository at this point in the history
- fixes import error
  • Loading branch information
Dr-Blank committed Nov 6, 2023
1 parent 4afa80c commit 3871110
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plexapi/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.
Expand Down Expand Up @@ -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,
Expand All @@ -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.
"""
Expand Down

0 comments on commit 3871110

Please sign in to comment.