diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-18 22:18:27 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-08-18 22:18:27 +0200 |
commit | bf23e30e4c6c548b94479b57aae5ebec14f9c95a (patch) | |
tree | 4ed839206f63f679e8ec1beca09e59fc80a6a073 /pkg/view | |
parent | a1f09d1f143012570a62bcb2a8fe51c439ad68fb (diff) | |
download | lens-bf23e30e4c6c548b94479b57aae5ebec14f9c95a.tar.gz lens-bf23e30e4c6c548b94479b57aae5ebec14f9c95a.tar.bz2 lens-bf23e30e4c6c548b94479b57aae5ebec14f9c95a.zip |
fix: Fix album and media navidation
Diffstat (limited to 'pkg/view')
-rw-r--r-- | pkg/view/album.go | 5 | ||||
-rw-r--r-- | pkg/view/media.go | 11 |
2 files changed, 8 insertions, 8 deletions
diff --git a/pkg/view/album.go b/pkg/view/album.go index a96b9bd..9e70b4b 100644 --- a/pkg/view/album.go +++ b/pkg/view/album.go @@ -85,8 +85,9 @@ func (self *AlbumView) Index(w http.ResponseWriter, r *http.Request) error { Albums: albums, Name: album.Name, Next: &repository.Pagination{ - Size: p.Size, - Page: p.Page + 1, + Size: p.Size, + Page: p.Page + 1, + AlbumID: &album.ID, }, Settings: settings, } diff --git a/pkg/view/media.go b/pkg/view/media.go index d5aace2..f490ce1 100644 --- a/pkg/view/media.go +++ b/pkg/view/media.go @@ -44,8 +44,7 @@ func getPagination(r *http.Request) *repository.Pagination { } if albumIDStr == "" { - id := uint(0) - albumID = &id + albumID = nil } else if p, err := strconv.Atoi(albumIDStr); err == nil { id := uint(p) albumID = &id @@ -133,9 +132,9 @@ func (self *MediaView) GetThumbnail(w http.ResponseWriter, r *http.Request) erro } func (self *MediaView) SetMyselfIn(r *ext.Router) { - r.GET("/media", self.Index) - r.POST("/media", self.Index) + r.GET("/media/", self.Index) + r.POST("/media/", self.Index) - r.GET("/media/image", self.GetImage) - r.GET("/media/thumbnail", self.GetThumbnail) + r.GET("/media/image/", self.GetImage) + r.GET("/media/thumbnail/", self.GetThumbnail) } |