-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix:stream extraction #97
Conversation
use the stream extractors before delegating to audio service
Caution Review failedThe pull request is closed. WalkthroughThe pull request introduces enhancements to the audio playback functionality in the Changes
Assessment against linked issues
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- ovos_audio/audio.py (2 hunks)
- requirements/extras.txt (1 hunks)
Additional context used
LanguageTool
requirements/extras.txt
[locale-violation] ~2-~2: 'server' é un xenismo. É preferíbel dicir "servidor"
Context: # TTS Plugins ovos-tts-plugin-server>=0.0.2, <1.0.0 # Media Playback plugin...(GL_BARBARISM_REPLACE)
[untranslated] ~4-~4: A palabra «Playback» é un anglicismo. Empregue mellor "son pregravado" ou "son de estudio".
Context: ...s-plugin-server>=0.0.2, <1.0.0 # Media Playback plugins ovos_audio_plugin_simple>=0.1.0...(PLAYBACK)
Ruff
ovos_audio/audio.py
388-388: Undefined name
List
(F821)
388-388: Undefined name
Union
(F821)
388-388: Undefined name
Tuple
(F821)
388-388: Undefined name
List
(F821)
391-391: Undefined name
load_stream_extractors
(F821)
Additional comments not posted (5)
requirements/extras.txt (3)
1-2
: LGTM!The new dependency for the TTS plugin server with the specified version constraint is approved.
Tools
LanguageTool
[locale-violation] ~2-~2: 'server' é un xenismo. É preferíbel dicir "servidor"
Context: # TTS Plugins ovos-tts-plugin-server>=0.0.2, <1.0.0 # Media Playback plugin...(GL_BARBARISM_REPLACE)
5-5
: LGTM!The new dependency for basic audio playback capabilities with the specified version constraint is approved.
6-7
: LGTM!The new dependency for integration with the MPV media player with the specified version constraint is approved.
ovos_audio/audio.py (2)
388-397
: LGTM!The new
_extract
method is a useful addition to handle the extraction of playable streams from various types of track URIs. The code is well-structured, follows a clear logic, and correctly handles both string URIs and tuples containing URIs and MIME types. The use of a lazy-loaded singleton of stream extractors is a good design choice for efficiency.Tools
Ruff
388-388: Undefined name
List
(F821)
388-388: Undefined name
Union
(F821)
388-388: Undefined name
Tuple
(F821)
388-388: Undefined name
List
(F821)
391-391: Undefined name
load_stream_extractors
(F821)
419-419
: LGTM!The modification to the
play
method is a necessary addition to integrate the new_extract
method. It ensures that theplay
method only operates on valid, extractable audio streams, enhancing the functionality and robustness of the method.
use the stream extractors before delegating to audio service
use the stream extractors before delegating to audio service
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
test/unittests/test_service.py (1)
62-71
: LGTM, but consider using a mock YouTube URL.The code changes are approved. The test class and method are correctly implemented, and the test is skipped due to a valid reason.
However, consider using a mock YouTube URL or a URL from a test video that is less likely to change in the future. This will make the test more robust and less likely to break due to external factors.
test/unittests/test_end2end.py (1)
93-152
: LGTM! Consider adding more assertions.The new test case
test_youtube
is well-structured and effectively tests the handling of YouTube URLs by the audio service. It follows the AAA (Arrange-Act-Assert) pattern and is self-contained.To further improve the test case, consider adding more assertions to validate the content of the emitted messages, such as checking the
data
field of theovos.common_play.media.state
andovos.common_play.track.state
messages to ensure that the correct media and track states are being set.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .github/workflows/unit_tests.yml (1 hunks)
- ovos_audio/audio.py (3 hunks)
- test/unittests/test_end2end.py (1 hunks)
- test/unittests/test_service.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- ovos_audio/audio.py
Additional comments not posted (1)
.github/workflows/unit_tests.yml (1)
53-53
: LGTM!The change to install the package with
.[extras]
is a good addition. It ensures that the optional dependencies are also installed during the testing phase, allowing the tests to cover the extended functionality provided by these dependencies.
use the stream extractors before delegating to audio service
allows directly sending things such as youtube urls to the audio service bus api
closes #81
Summary by CodeRabbit
New Features
Bug Fixes