mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
Add attribute for Sonic Analysis (#814)
* adding new attribute found in Albums and Tracks when Sonically Analyzed * update docstring and add property hasSonicAnalysis
This commit is contained in:
parent
9f9e235000
commit
168f1d331c
1 changed files with 7 additions and 0 deletions
|
@ -28,6 +28,7 @@ class Audio(PlexPartialObject):
|
|||
librarySectionTitle (str): :class:`~plexapi.library.LibrarySection` title.
|
||||
listType (str): Hardcoded as 'audio' (useful for search filters).
|
||||
moods (List<:class:`~plexapi.media.Mood`>): List of mood objects.
|
||||
musicAnalysisVersion (int): The Plex music analysis version for the item.
|
||||
ratingKey (int): Unique key identifying the item.
|
||||
summary (str): Summary of the artist, album, or track.
|
||||
thumb (str): URL to thumbnail image (/library/metadata/<ratingKey>/thumb/<thumbid>).
|
||||
|
@ -59,6 +60,7 @@ class Audio(PlexPartialObject):
|
|||
self.librarySectionTitle = data.attrib.get('librarySectionTitle')
|
||||
self.listType = 'audio'
|
||||
self.moods = self.findItems(data, media.Mood)
|
||||
self.musicAnalysisVersion = utils.cast(int, data.attrib.get('musicAnalysisVersion'))
|
||||
self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
|
||||
self.summary = data.attrib.get('summary')
|
||||
self.thumb = data.attrib.get('thumb')
|
||||
|
@ -78,6 +80,11 @@ class Audio(PlexPartialObject):
|
|||
""" Returns str, default title for a new syncItem. """
|
||||
return self.title
|
||||
|
||||
@property
|
||||
def hasSonicAnalysis(self):
|
||||
""" Returns True if the audio has been sonically analyzed. """
|
||||
return self.musicAnalysisVersion == 1
|
||||
|
||||
def sync(self, bitrate, client=None, clientId=None, limit=None, title=None):
|
||||
""" Add current audio (artist, album or track) as sync item for specified device.
|
||||
See :func:`~plexapi.myplex.MyPlexAccount.sync` for possible exceptions.
|
||||
|
|
Loading…
Reference in a new issue