From 25504b697cb94849a15e3f6d6535490dfd38c2bf Mon Sep 17 00:00:00 2001 From: DDanii Date: Wed, 13 Apr 2022 20:27:59 +0200 Subject: [PATCH] Prevent item appear in media browser if name starts with dot (#69820) --- homeassistant/components/media_source/local_source.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/media_source/local_source.py b/homeassistant/components/media_source/local_source.py index 66baa0eaa8c..37118e69051 100644 --- a/homeassistant/components/media_source/local_source.py +++ b/homeassistant/components/media_source/local_source.py @@ -180,9 +180,10 @@ class LocalSource(MediaSource): # Append first level children media.children = [] for child_path in path.iterdir(): - child = self._build_item_response(source_dir_id, child_path, True) - if child: - media.children.append(child) + if child_path.name[0] != ".": + child = self._build_item_response(source_dir_id, child_path, True) + if child: + media.children.append(child) # Sort children showing directories first, then by name media.children.sort(key=lambda child: (child.can_play, child.title))