fieat(gallery): recursive image search
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user