diff --git a/pkg/models/photo.go b/pkg/models/photo.go index db854a3..70715db 100644 --- a/pkg/models/photo.go +++ b/pkg/models/photo.go @@ -194,6 +194,11 @@ func PaginateUserPhotos(userID uint64, conf UserGallery, pager *Pagination) ([]* // View a photo, incrementing its Views count but not its UpdatedAt. // Debounced with a Redis key. func (p *Photo) View(userID uint64) error { + // The owner of the photo does not count views. + if p.UserID == userID { + return nil + } + // Debounce this. var redisKey = fmt.Sprintf(config.PhotoViewDebounceRedisKey, userID, p.ID) if redis.Exists(redisKey) { diff --git a/web/templates/photo/gallery.html b/web/templates/photo/gallery.html index 1fa19bb..6fbfa90 100644 --- a/web/templates/photo/gallery.html +++ b/web/templates/photo/gallery.html @@ -542,6 +542,8 @@ {{if HasSuffix .Filename ".mp4"}}