aboutsummaryrefslogtreecommitdiff
path: root/pkg/worker
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-18 21:41:53 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-18 21:41:53 +0200
commit69d71c2a495d9cce1984ba2ffddf1d98622b01fe (patch)
tree3abd105a970fe773c0b19cb0c4f974688001e5e0 /pkg/worker
parent05a8dbf46792adfef007a0ffbcb654026db036fa (diff)
downloadlens-69d71c2a495d9cce1984ba2ffddf1d98622b01fe.tar.gz
lens-69d71c2a495d9cce1984ba2ffddf1d98622b01fe.tar.bz2
lens-69d71c2a495d9cce1984ba2ffddf1d98622b01fe.zip
feat: Move to user path media
Now media also base on user folder to fetch its media.
Diffstat (limited to 'pkg/worker')
-rw-r--r--pkg/worker/scanner/thumbnail_scanner.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/worker/scanner/thumbnail_scanner.go b/pkg/worker/scanner/thumbnail_scanner.go
index 02fd4dd..8245ead 100644
--- a/pkg/worker/scanner/thumbnail_scanner.go
+++ b/pkg/worker/scanner/thumbnail_scanner.go
@@ -35,6 +35,12 @@ func (t *ThumbnailScanner) Query(ctx context.Context) ([]*repository.Media, erro
})
}
+func (t *ThumbnailScanner) OnFail(ctx context.Context, media *repository.Media, err error) {
+ _ = t.repository.CreateThumbnail(ctx, media.ID, &repository.MediaThumbnail{
+ Path: "",
+ })
+}
+
func (t *ThumbnailScanner) Process(ctx context.Context, media *repository.Media) error {
split := media.PathHash[:2]
filename := media.PathHash[2:]