-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add sonicAdventure method to MusicSection #1361
Conversation
not sure if I understand why the tests failed for this change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe sonic adventure is a Plex Pass feature so it will need to be an authenticated test.
It might also be useful to add a convenience method to tracks.
def sonicAdventure(self, to):
self.section().sonicAdventure(start=self, end=to)
>>> track1.sonicAdventure(to=track2)
I did not add this in this PR as to not clutter it like I have a habit to, which makes it more cumbersome to review. was holding it off for once this was merged/approved |
tests/test_audio.py
Outdated
@@ -398,6 +399,14 @@ def test_audio_Track_lyricStreams(track): | |||
assert not track.lyricStreams() | |||
|
|||
|
|||
@pytest.mark.authenticated | |||
def test_audio_Track_sonicAdventure(music): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these tests work on the bootstrap test server? It only has one track and we disable all the analysis tasks (although it looks like we forgot to disable sonic analysis).
python-plexapi/tools/plex-bootstraptest.py
Lines 502 to 503 in b51aa19
# Disable settings for background tasks when using the test server. | |
# These tasks won't work on the test server since we are using fake media files |
Also needs a Plex Pass account.
def test_audio_Track_sonicAdventure(music): | |
def test_audio_Track_sonicAdventure(account_plexpass, music): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might not, I changed my bootstrap server by adding a few tracks from my collection to test these features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this does not work on the bootstrap server with a single track, or even two tracks.
The tests fail at assert len(adventure)
because there are no computed tracks. I think we just check if it is a list assert isinstance(adventure, list)
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this does not work on the bootstrap server with a single track, or even two tracks.
would return list of 2 tracks, same as the args if not adventure between them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this on my own server and it returns a blank list. The start and end are not included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I would be wrong on this then, however the tests should be okay regardless
Co-authored-by: JonnyWong16 <[email protected]>
- add type to docstr
- pass in plexpass account to tests Co-authored-by: JonnyWong16 <[email protected]>
…hon-plexapi into feat/sonicAdventure
- still asserts it is an iterable - still checks all elements are tracks - in case no adventure found, does not fail
Fixes #1360
Type of change
Please delete options that are not relevant.
Checklist: