fieat(gallery): recursive image search

This commit is contained in:
2026-06-01 13:45:41 +02:00
parent 9ca81d7f13
commit 2db36e2ada
2 changed files with 43 additions and 1 deletions
+3 -1
View File
@@ -41,10 +41,11 @@ func (s *Service) autoRefresh() {
}
func (s *Service) assembleImageList(ctx context.Context) error {
files, err := s.fs.ReadDir(s.cfg.Path)
files, err := s.readDirRecursive(s.cfg.Path)
if err != nil {
return fmt.Errorf("could not read contents of %s: %w", s.cfg.Path, err)
}
slog.Debug("loaded files", "files", files)
savedHash, _ := s.cache.Do(ctx, s.cache.B().Get().Key(hashKey).Build()).AsBytes()
@@ -67,6 +68,7 @@ func (s *Service) assembleImageList(ctx context.Context) error {
imagePath := path.Join(s.cfg.Path, file.Name())
img, err := s.img.GetImage(imagePath)
if err != nil || img.Image == nil {
slog.Warn("could not get image for gallery", "err", err, "img", img)
continue
}