Add audio_streams property to plex media
from plexapi import X_PLEX_CONTAINER_SIZE
from plexapi.exceptions import BadRequest, NotFound, Unauthorized
from plexapi.library import LibrarySection, MovieSection, ShowSection
-from plexapi.media import VideoStream
+from plexapi.media import VideoStream, AudioStream
from plexapi.server import PlexServer, SystemAccount, SystemDevice
from plexapi.video import Episode, Movie, Show
from trakt.utils import timestamp
@@ -192,6 +192,10 @@ def streams(self, cls):
if isinstance(stream, cls):
yield stream
+ @property
+ def audio_streams(self):
+ return self.streams(AudioStream)
+
@property
def video_streams(self):
return self.streams(VideoStream)
