aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/repository
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/database/repository')
-rw-r--r--pkg/database/repository/media.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/database/repository/media.go b/pkg/database/repository/media.go
index 6f5b39b..d6addbf 100644
--- a/pkg/database/repository/media.go
+++ b/pkg/database/repository/media.go
@@ -34,6 +34,10 @@ type (
GPSLongitude *float64
}
+ Album struct {
+ ID uint
+ }
+
MediaThumbnail struct {
Path string
}
@@ -51,6 +55,17 @@ type (
MIMEType string
}
+ CreateAlbum struct {
+ ParentID *uint
+ Name string
+ Path string
+ }
+
+ CreateAlbumFile struct {
+ MediaID uint
+ AlbumID uint
+ }
+
MediaRepository interface {
Create(context.Context, *CreateMedia) error
Exists(context.Context, string) (bool, error)
@@ -66,6 +81,12 @@ type (
ListEmptyThumbnail(context.Context, *Pagination) ([]*Media, error)
GetThumbnail(context.Context, uint) (*MediaThumbnail, error)
CreateThumbnail(context.Context, uint, *MediaThumbnail) error
+
+ ListEmptyAlbums(context.Context, *Pagination) ([]*Media, error)
+ ExistsAlbumByAbsolutePath(context.Context, string) (bool, error)
+ GetAlbumByAbsolutePath(context.Context, string) (*Album, error)
+ CreateAlbum(context.Context, *CreateAlbum) (*Album, error)
+ CreateAlbumFile(context.Context, *CreateAlbumFile) error
}
)