aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/repository
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-31 18:25:13 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-08-06 18:41:34 +0200
commit5f660b309bc695277c67223520499fcc13f3c59f (patch)
treece30f46d8feebac6eb3f5145e9c772be1c32f4ad /pkg/database/repository
parent5168a9476f0e83264ecafc85bc9145e8bdcbb8dc (diff)
downloadlens-5f660b309bc695277c67223520499fcc13f3c59f.tar.gz
lens-5f660b309bc695277c67223520499fcc13f3c59f.tar.bz2
lens-5f660b309bc695277c67223520499fcc13f3c59f.zip
feat: Add album scanner
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
}
)