mirror of
https://github.com/ente-io/ente.git
synced 2025-05-02 12:08:03 +00:00
25 lines
902 B
Go
25 lines
902 B
Go
package collections
|
|
|
|
import (
|
|
"github.com/ente-io/museum/ente"
|
|
"github.com/ente-io/stacktrace"
|
|
)
|
|
|
|
// GetOwnedV2 returns the list of collections owned by a user using optimized query
|
|
func (c *CollectionController) GetOwnedV2(userID int64, sinceTime int64, app ente.App, limit *int64) ([]ente.Collection, error) {
|
|
collections, err := c.CollectionRepo.GetCollectionsOwnedByUserV2(userID, sinceTime, app, limit)
|
|
if err != nil {
|
|
return nil, stacktrace.Propagate(err, "")
|
|
}
|
|
return collections, nil
|
|
}
|
|
|
|
// GetSharedWith returns the list of collections that are shared with a user
|
|
func (c *CollectionController) GetSharedWith(userID int64, sinceTime int64, app ente.App, limit *int64) ([]ente.Collection, error) {
|
|
collections, err := c.CollectionRepo.GetCollectionsSharedWithUser(userID, sinceTime, app, limit)
|
|
if err != nil {
|
|
return nil, stacktrace.Propagate(err, "")
|
|
}
|
|
return collections, nil
|
|
}
|