From 311d634157e23878e9a6cc0241f7e8cd98b47387 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sat, 6 Mar 2021 12:22:55 -0300 Subject: [PATCH] Add .nbmedias to get the nb of files in an album --- sigal/gallery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sigal/gallery.py b/sigal/gallery.py index 1052a11..0aa1d6b 100644 --- a/sigal/gallery.py +++ b/sigal/gallery.py @@ -472,6 +472,10 @@ class Album: return [self.gallery.albums[join(root_path, path)] for path in self.subdirs] + @property + def nbmedias(self): + return len(self.medias) + sum(len(album) for album in self.albums) + @property def url(self): """URL of the album, relative to its parent."""