From bcee25c6c648bbae4da51701d0aba2cdefad0d91 Mon Sep 17 00:00:00 2001 From: cwilvx Date: Tue, 17 Jun 2025 13:10:35 +0300 Subject: [PATCH] fix: showing non-existing paths on homepage --- swingmusic/lib/home/create_items.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swingmusic/lib/home/create_items.py b/swingmusic/lib/home/create_items.py index ec01a273..079a19fe 100644 --- a/swingmusic/lib/home/create_items.py +++ b/swingmusic/lib/home/create_items.py @@ -1,4 +1,5 @@ import os +import pathlib from swingmusic.db.userdata import PlaylistTable from swingmusic.lib.home import find_mix from swingmusic.lib.home.recentlyadded import get_recently_added_playlist @@ -98,9 +99,12 @@ def create_items(entries: list[TrackLog], limit: int): if is_home_dir: folder = os.path.expanduser("~") + if not pathlib.Path(folder).exists(): + continue + item = { "type": "folder", - "hash": entry.type_src, + "hash": folder, "timestamp": entry.timestamp, }