Skip to content
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

Tidy Roon media_browser following recently merged PR #42276

Merged
merged 2 commits into from
Oct 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions homeassistant/components/roon/media_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def browse_media(zone_id, roon_server, media_content_type=None, media_content_id
def item_payload(roon_server, item, list_image_id):
"""Create response payload for a single media item."""

title = item.get("title")
title = item["title"]
subtitle = item.get("subtitle")
if subtitle is None:
display_title = title
Expand All @@ -67,7 +67,7 @@ def item_payload(roon_server, item, list_image_id):
if image_id:
image = roon_server.roonapi.get_image(image_id)

media_content_id = item.get("item_key")
media_content_id = item["item_key"]
media_content_type = "library"

hint = item.get("hint")
Expand Down Expand Up @@ -118,7 +118,7 @@ def library_payload(roon_server, zone_id, media_content_id):
content_id = media_content_id

result_header = roon_server.roonapi.browse_browse(opts)
_LOGGER.debug("result_header %s", result_header)
_LOGGER.debug("Result_header %s", result_header)
pavoni marked this conversation as resolved.
Show resolved Hide resolved

header = result_header["list"]
title = header.get("title")
Expand Down Expand Up @@ -146,7 +146,7 @@ def library_payload(roon_server, zone_id, media_content_id):
result_detail = roon_server.roonapi.browse_load(opts)
_LOGGER.debug("result_detail %s", result_detail)
pavoni marked this conversation as resolved.
Show resolved Hide resolved

items = result_detail.get("items")
items = result_detail["items"]
count = len(items)

if count < total_count:
Expand Down