Show warning when library is empty or unreachable

Covers both unmounted drives (dir exists but empty) and
missing directories with red warning text.
This commit is contained in:
pax 2026-04-05 02:50:10 -05:00
parent 4ffc2afc84
commit 781f03e85b

View File

@ -99,12 +99,16 @@ class LibraryView(QWidget):
self._grid.set_posts(0) self._grid.set_posts(0)
self._files = [] self._files = []
return return
self._count_label.setStyleSheet("")
self._refresh_folders() self._refresh_folders()
self._files = self._scan_files() self._files = self._scan_files()
self._sort_files() self._sort_files()
self._count_label.setText(f"{len(self._files)} files") if self._files:
self._count_label.setText(f"{len(self._files)} files")
self._count_label.setStyleSheet("")
else:
self._count_label.setText("Library empty or directory unreachable")
self._count_label.setStyleSheet("color: #ff4444;")
thumbs = self._grid.set_posts(len(self._files)) thumbs = self._grid.set_posts(len(self._files))
lib_thumb_dir = thumbnails_dir() / "library" lib_thumb_dir = thumbnails_dir() / "library"