From 6404b76c97796930f7777da31a4f8b8ac06a8d44 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sun, 16 Jun 2019 21:43:59 -0700 Subject: [PATCH] Add views counter to album, photo and share --- internal/models/album.go | 1 + internal/models/photo.go | 1 + internal/models/share.go | 1 + 3 files changed, 3 insertions(+) diff --git a/internal/models/album.go b/internal/models/album.go index 161d443ee..15270ce26 100644 --- a/internal/models/album.go +++ b/internal/models/album.go @@ -13,6 +13,7 @@ type Album struct { AlbumName string AlbumDescription string `gorm:"type:text;"` AlbumNotes string `gorm:"type:text;"` + AlbumViews uint AlbumPhoto *Photo AlbumPhotoID uint AlbumFavorite bool diff --git a/internal/models/photo.go b/internal/models/photo.go index a3e4d827e..ec9f4348e 100644 --- a/internal/models/photo.go +++ b/internal/models/photo.go @@ -25,6 +25,7 @@ type Photo struct { PhotoLong float64 PhotoFocalLength float64 PhotoAperture float64 + PhotoViews uint Camera *Camera CameraID uint Lens *Lens diff --git a/internal/models/share.go b/internal/models/share.go index 0ce519c18..70d64ec0d 100644 --- a/internal/models/share.go +++ b/internal/models/share.go @@ -13,6 +13,7 @@ type Share struct { ShareUUID string `gorm:"primary_key;auto_increment:false"` PhotoID uint AlbumID uint + ShareViews uint ShareSecret string SharePassword string ShareExpires time.Time