From a71946a2eaabf82e5581f451be3465df1932d7dd Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 25 Jan 2021 12:36:10 +0100 Subject: [PATCH] Albums: Hide folders with private photos only #942 --- internal/photoprism/moments.go | 2 -- internal/query/albums.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/photoprism/moments.go b/internal/photoprism/moments.go index 297f11026..9ead2e3e6 100644 --- a/internal/photoprism/moments.go +++ b/internal/photoprism/moments.go @@ -96,8 +96,6 @@ func (m *Moments) Start() (err error) { } } - // PhotoPath - // All years and months. if results, err := query.MomentsTime(1); err != nil { log.Errorf("moments: %s", err.Error()) diff --git a/internal/query/albums.go b/internal/query/albums.go index b5dbb6233..fb1acbd66 100644 --- a/internal/query/albums.go +++ b/internal/query/albums.go @@ -114,7 +114,7 @@ func AlbumSearch(f form.AlbumSearch) (results AlbumResults, err error) { Select("albums.*, cp.photo_count, cl.link_count"). Joins("LEFT JOIN (SELECT album_uid, count(photo_uid) AS photo_count FROM photos_albums WHERE hidden = 0 AND missing = 0 GROUP BY album_uid) AS cp ON cp.album_uid = albums.album_uid"). Joins("LEFT JOIN (SELECT share_uid, count(share_uid) AS link_count FROM links GROUP BY share_uid) AS cl ON cl.share_uid = albums.album_uid"). - Where("albums.album_type <> 'folder' OR albums.album_path IN (SELECT photos.photo_path FROM photos WHERE photos.deleted_at IS NULL)"). + Where("albums.album_type <> 'folder' OR albums.album_path IN (SELECT photos.photo_path FROM photos WHERE photos.photo_private = 0 AND photos.deleted_at IS NULL)"). Where("albums.deleted_at IS NULL") // Limit result count.