#Missing media source dit
1 messages ยท Page 1 of 1 (latest)
So I think an option could be
- Passing on a translation key instead, so we can just use a translation string to set the error (as these errors aren't translatable yet)
- As the media source is registered per domain, we could make a standard exception translation key we use for this. So like, if this exception happens we use the
missing_media_directoryexception from the strings. When missing we use the default.
When I was thinking about this it sounded really great, but now that I think about it, all exceptions come from the backend, so we'd have to check in the backend if that key exists. (Assuming the frontend has very little logic around exceptions here, given that it just shows what we throw back)
just accept my PRs. ๐ It would be my first ๐ฃ
hehe
but as this is something other integrations can use I want to make sure this is the direction we're headed
And as currently everything is still hard coded (and thus not translatable) I also want to see that if we want to do it like that, how we can make it translatable from the start
yes, I understand.
There's not some way to just not show this tile at all in the media browser if it's not configured/usable?
I'm sure most don't use this and some people were griping about it, like why did it appear there.
like balloob is suggesting? https://github.com/home-assistant/core/compare/dev...media-source-no-error-non-exist, https://github.com/home-assistant/frontend/pull/51699#issuecomment-4313237720
Breaking change
Proposed change
Currently, in the media browser, if the AI-generated images option is selected, but no images have been generated yet, the error message points to
https://www.home...
Not exactly, I asked more why is the top level item presented at all, for a user who never does any AI media generation.
Rather than create a clickable empty directory.
Anyway I'm digressing, I guess a empty folder is a valid way to fix the error as well.
I guess we do have a pattern where we rather show an unavailable option and tell them what's wrong when trying to use instead of hiding it
That's what I remember at least