Albums: Hide folders with private photos only #942

This commit is contained in:
Michael Mayer 2021-01-25 12:36:10 +01:00
parent 0ffbd82ee4
commit a71946a2ea
2 changed files with 1 additions and 3 deletions

View file

@ -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())

View file

@ -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.