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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add media browser support to dlna_dmr #66425
Conversation
Uses media_source to browse any available source, including local files and DLNA Media Servers (when supported).
Hey there @StevenLooman, mind taking a look at this pull request as it has been labeled with an integration ( |
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.
LGTM. Expected this to be more code, but glad hass already provides the infrastructure.
Thanks :) Some of the features in hass that this uses (like content_type filters and URL signing) were only very recently added (e.g. #64641 and #66120). The DLNA Digital Media Server side of things is being done in a separate PR (#66437). That's where the bulk of the effort is. |
media_type = sourced_media.mime_type | ||
media_id = sourced_media.url | ||
_LOGGER.debug("sourced_media is %s", sourced_media) | ||
if sourced_metadata := getattr(sourced_media, "didl_metadata", None): |
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.
Can you use isinstance
to detect if you're browsing UPNP media?
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 could (and did originally), but that then needs an explicit import of the dlna_dms
component, and therefore a dependency within the dlna_dmr manifest. This current approach is also a bit more flexible because it can handle other integrations extending PlayMedia
with a didl_metadata
attribute, and they don't have to depend on dlna_dms
for it to work.
This has also led me to think about how media sources can provide metadata to media players more generally. I'll work up an architecture discussion for that next week.
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.
Nice! 馃帀 1 tiny comment left.
Proposed change
Uses
media_source
to browse any available source, including local files and DLNA Media Servers (when support is added in a future PR).Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: