UX: Show total number of pictures without images in overview #3164

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2023-02-03 08:23:46 +01:00
parent 2e7268f834
commit 52a220044d
3 changed files with 9 additions and 1 deletions

View file

@ -320,6 +320,8 @@ export default class Config {
this.values.count.favorites += data.count;
break;
case "review":
this.values.count.all -= data.count;
this.values.count.photos -= data.count;
this.values.count.review += data.count;
break;
case "private":

View file

@ -182,7 +182,7 @@ func BatchPhotosApprove(router *gin.RouterGroup) {
var approved entity.Photos
for _, p := range photos {
if err := p.Approve(); err != nil {
if err = p.Approve(); err != nil {
log.Errorf("approve: %s", err)
} else {
approved = append(approved, p)

View file

@ -500,8 +500,14 @@ func (c *Config) ClientUser(withSettings bool) ClientConfig {
Take(&cfg.Count)
}
// Calculate total count.
cfg.Count.All = cfg.Count.Photos + cfg.Count.Live + cfg.Count.Videos
// Exclude pictures in review from total count.
if c.Settings().Features.Review {
cfg.Count.All = cfg.Count.All - cfg.Count.Review
}
c.Db().
Table("labels").
Select("MAX(photo_count) AS label_max_photos, COUNT(*) AS labels").