diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-29 23:21:56 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-29 23:21:56 +0200 |
commit | 1ae70dbd9124675d4a510954619b01edd5f1f6c3 (patch) | |
tree | e6db7f5553a00094d048b6a4d03163853a5a4e7c /pkg/worker/exif_scanner.go | |
parent | 024da3e546e98cbaeea5f7bc86af12b671996f41 (diff) | |
download | lens-1ae70dbd9124675d4a510954619b01edd5f1f6c3.tar.gz lens-1ae70dbd9124675d4a510954619b01edd5f1f6c3.tar.bz2 lens-1ae70dbd9124675d4a510954619b01edd5f1f6c3.zip |
ref: Move away other repositories
Finish moving all repositories to a repository package. This should
reduce the amount of packages.
Diffstat (limited to 'pkg/worker/exif_scanner.go')
-rw-r--r-- | pkg/worker/exif_scanner.go | 16 |
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 } |