Update plexapi==4.15.11

This commit is contained in:
JonnyWong16 2024-03-31 16:11:00 -07:00
parent 653a6d5c12
commit 85519b1b45
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
8 changed files with 173 additions and 16 deletions

View file

@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import os
from pathlib import Path
from urllib.parse import quote_plus
@ -17,6 +19,7 @@ from plexapi.playlist import Playlist
TAudio = TypeVar("TAudio", bound="Audio")
TTrack = TypeVar("TTrack", bound="Track")
class Audio(PlexPartialObject, PlayedUnplayedMixin):
@ -532,6 +535,22 @@ class Track(
guid_hash = utils.sha1hash(self.parentGuid)
return str(Path('Metadata') / 'Albums' / guid_hash[0] / f'{guid_hash[1:]}.bundle')
def sonicAdventure(
self: TTrack,
to: TTrack,
**kwargs: Any,
) -> list[TTrack]:
"""Returns a sonic adventure from the current track to the specified track.
Parameters:
to (:class:`~plexapi.audio.Track`): The target track for the sonic adventure.
**kwargs: Additional options passed into :func:`~plexapi.library.MusicSection.sonicAdventure`.
Returns:
List[:class:`~plexapi.audio.Track`]: list of tracks in the sonic adventure.
"""
return self.section().sonicAdventure(self, to, **kwargs)
@utils.registerPlexObject
class TrackSession(PlexSession, Track):