Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Make linter happy

Neeraj Gupta4d5b44a4c1f5
diff --git a/server/ente/public_collection.go b/server/ente/public_collection.go
index 420a215f79..7a477c4365 100644
--- a/server/ente/public_collection.go
+++ b/server/ente/public_collection.go
@@ -63,10 +63,10 @@ func (p PublicCollectionToken) CanJoin() error {
if p.ValidTill > 0 && p.ValidTill < time.Microseconds() {
return NewBadRequestWithMessage("token expired")
}
- if p.EnableDownload == false {
+ if !p.EnableDownload {
return NewBadRequestWithMessage("can not join as download is disabled")
}
- if p.EnableJoin == false {
+ if !p.EnableJoin {
return NewBadRequestWithMessage("can not join as join is disabled")
}
return nil
diff --git a/server/migrations/95_public_collection_join_album.down.sql b/server/migrations/95_public_collection_join_album.down.sql
index e6107881e0..134128116f 100644
--- a/server/migrations/95_public_collection_join_album.down.sql
+++ b/server/migrations/95_public_collection_join_album.down.sql
@@ -1,2 +1,2 @@
ALTER TABLE public_collection_tokens
- DROP COLUMN IF EXISTS enable_join;
\ No newline at end of file
+ DROP COLUMN IF EXISTS enable_join;
diff --git a/server/pkg/controller/collection.go b/server/pkg/controller/collection.go
index 95b8e1ed93..7476de1c39 100644
--- a/server/pkg/controller/collection.go
+++ b/server/pkg/controller/collection.go
@@ -193,7 +193,7 @@ func (c *CollectionController) JoinViaLink(ctx *gin.Context, req ente.JoinCollec
if !collection.AllowSharing() {
return stacktrace.Propagate(ente.ErrBadRequest, fmt.Sprintf("joining %s is not allowed", collection.Type))
}
- publicCollectionToken, err := c.PublicCollectionCtrl.GetCollectionSummaryByToken(ctx, req.CollectionID)
+ publicCollectionToken, err := c.PublicCollectionCtrl.GetActivePublicCollectionToken(ctx, req.CollectionID)
if err != nil {
return stacktrace.Propagate(err, "")
}
diff --git a/server/pkg/controller/public_collection.go b/server/pkg/controller/public_collection.go
index 9ab67b1730..d9b5e29b77 100644
--- a/server/pkg/controller/public_collection.go
+++ b/server/pkg/controller/public_collection.go
@@ -91,7 +91,7 @@ func (c *PublicCollectionController) CreateAccessToken(ctx context.Context, req
return response, nil
}
-func (c *PublicCollectionController) GetCollectionSummaryByToken(ctx context.Context, collectionID int64) (ente.PublicCollectionToken, error) {
+func (c *PublicCollectionController) GetActivePublicCollectionToken(ctx context.Context, collectionID int64) (ente.PublicCollectionToken, error) {
return c.PublicCollectionRepo.GetActivePublicCollectionToken(ctx, collectionID)
}