aboutsummaryrefslogtreecommitdiff
path: root/pkg/worker/exif_scanner.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/worker/exif_scanner.go')
-rw-r--r--pkg/worker/exif_scanner.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/worker/exif_scanner.go b/pkg/worker/exif_scanner.go
index 91eed12..97790a0 100644
--- a/pkg/worker/exif_scanner.go
+++ b/pkg/worker/exif_scanner.go
@@ -3,27 +3,27 @@ package worker
import (
"context"
- "git.sr.ht/~gabrielgio/img/pkg/components/media"
"git.sr.ht/~gabrielgio/img/pkg/coroutine"
+ "git.sr.ht/~gabrielgio/img/pkg/database/repository"
"git.sr.ht/~gabrielgio/img/pkg/fileop"
)
type (
EXIFScanner struct {
- repository media.Repository
+ repository repository.MediaRepository
}
)
-var _ BatchProcessor[*media.Media] = &EXIFScanner{}
+var _ BatchProcessor[*repository.Media] = &EXIFScanner{}
-func NewEXIFScanner(repository media.Repository) *EXIFScanner {
+func NewEXIFScanner(repository repository.MediaRepository) *EXIFScanner {
return &EXIFScanner{
repository: repository,
}
}
-func (e *EXIFScanner) Query(ctx context.Context) ([]*media.Media, error) {
- medias, err := e.repository.GetEmptyEXIF(ctx, &media.Pagination{
+func (e *EXIFScanner) Query(ctx context.Context) ([]*repository.Media, error) {
+ medias, err := e.repository.GetEmptyEXIF(ctx, &repository.Pagination{
Page: 0,
Size: 100,
})
@@ -34,8 +34,8 @@ func (e *EXIFScanner) Query(ctx context.Context) ([]*media.Media, error) {
return medias, nil
}
-func (e *EXIFScanner) Process(ctx context.Context, m *media.Media) error {
- exif, err := coroutine.WrapProcess(ctx, func() (*media.MediaEXIF, error) { return fileop.ReadExif(m.Path) })
+func (e *EXIFScanner) Process(ctx context.Context, m *repository.Media) error {
+ exif, err := coroutine.WrapProcess(ctx, func() (*repository.MediaEXIF, error) { return fileop.ReadExif(m.Path) })
if err != nil {
return err
}