mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Prevent item appear in media browser if name starts with dot (#69820)
This commit is contained in:
parent
f456996e12
commit
25504b697c
@ -180,9 +180,10 @@ class LocalSource(MediaSource):
|
|||||||
# Append first level children
|
# Append first level children
|
||||||
media.children = []
|
media.children = []
|
||||||
for child_path in path.iterdir():
|
for child_path in path.iterdir():
|
||||||
child = self._build_item_response(source_dir_id, child_path, True)
|
if child_path.name[0] != ".":
|
||||||
if child:
|
child = self._build_item_response(source_dir_id, child_path, True)
|
||||||
media.children.append(child)
|
if child:
|
||||||
|
media.children.append(child)
|
||||||
|
|
||||||
# Sort children showing directories first, then by name
|
# Sort children showing directories first, then by name
|
||||||
media.children.sort(key=lambda child: (child.can_play, child.title))
|
media.children.sort(key=lambda child: (child.can_play, child.title))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user