Fix blocking stat call in local media_source (#127587)

This commit is contained in:
J. Nick Koston 2024-10-05 03:17:07 -05:00 committed by GitHub
parent b8d252273d
commit 0177facbf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -225,7 +225,7 @@ class LocalMediaView(http.HomeAssistantView):
media_path = self.source.async_full_path(source_dir_id, location)
# Check that the file exists
if not media_path.is_file():
if not self.hass.async_add_executor_job(media_path.is_file):
raise web.HTTPNotFound
# Check that it's a media file