mirror of
https://github.com/ente-io/ente.git
synced 2025-05-03 12:12:28 +00:00
25 lines
860 B
Go
25 lines
860 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) ([]ente.Collection, error) {
|
|
collections, err := c.CollectionRepo.GetCollectionsOwnedByUserV2(userID, sinceTime, app)
|
|
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) ([]ente.Collection, error) {
|
|
collections, err := c.CollectionRepo.GetCollectionsSharedWithUser(userID, sinceTime, app)
|
|
if err != nil {
|
|
return nil, stacktrace.Propagate(err, "")
|
|
}
|
|
return collections, nil
|
|
}
|