mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 06:04:15 +00:00
Add Video.audioStreams()
convenience method (#891)
* Add Video.audioStreams() convenience method * Add test for Video.audioStreams()
This commit is contained in:
parent
3e57c9b262
commit
87a7ec6ddf
2 changed files with 16 additions and 2 deletions
|
@ -111,6 +111,15 @@ class Video(PlexPartialObject):
|
|||
""" Returns str, default title for a new syncItem. """
|
||||
return self.title
|
||||
|
||||
def audioStreams(self):
|
||||
""" Returns a list of :class:`~plexapi.media.AudioStream` objects for all MediaParts. """
|
||||
streams = []
|
||||
|
||||
parts = self.iterParts()
|
||||
for part in parts:
|
||||
streams += part.audioStreams()
|
||||
return streams
|
||||
|
||||
def subtitleStreams(self):
|
||||
""" Returns a list of :class:`~plexapi.media.SubtitleStream` objects for all MediaParts. """
|
||||
streams = []
|
||||
|
|
|
@ -361,11 +361,16 @@ def test_video_Movie_download(monkeydownload, tmpdir, movie):
|
|||
assert filename in with_resolution[0]
|
||||
|
||||
|
||||
def test_video_Movie_subtitlestreams(movie):
|
||||
def test_video_Movie_audioStreams(movie):
|
||||
movie.reload()
|
||||
assert movie.audioStreams()
|
||||
|
||||
|
||||
def test_video_Movie_subtitleStreams(movie):
|
||||
assert not movie.subtitleStreams()
|
||||
|
||||
|
||||
def test_video_Episode_subtitlestreams(episode):
|
||||
def test_video_Episode_subtitleStreams(episode):
|
||||
assert not episode.subtitleStreams()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue