From 1ae70dbd9124675d4a510954619b01edd5f1f6c3 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Thu, 29 Jun 2023 23:21:56 +0200 Subject: ref: Move away other repositories Finish moving all repositories to a repository package. This should reduce the amount of packages. --- pkg/worker/exif_scanner.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pkg/worker/exif_scanner.go') 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 } -- cgit v1.2.3