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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle media browser errors #6813

Merged
merged 4 commits into from
Sep 7, 2020
Merged

Handle media browser errors #6813

merged 4 commits into from
Sep 7, 2020

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Sep 7, 2020

Proposed change

Handle media browsers better, so it doesn't break the UI and we explain the user how he can make it work.

Needs home-assistant/core#39759

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@@ -92,11 +94,54 @@ export class HaMediaPlayerBrowse extends LitElement {
this._navigate(item);
}

private _renderError(err: { message: string; code: string }) {
if (err.message === "Path does not exist.") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a backend change this should be:

Suggested change
if (err.message === "Path does not exist.") {
if (err.code === "no_media_folder") {

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
<p>
Check the
<a
href="https://www.home-assistant.io/integrations/media_source/#local-media"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the RC site if the version contains a "b" here?
This will go to a non-exsisting site during the beta

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do that, we should get a helper method and apply that everywhere. I think it's fine for now.

@bramkragten bramkragten merged commit 046f7b5 into dev Sep 7, 2020
@bramkragten bramkragten deleted the handle-media-browse-errors branch September 7, 2020 18:39
@bramkragten bramkragten mentioned this pull request Sep 7, 2020
@spacegaier spacegaier mentioned this pull request Sep 8, 2020
9 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants