aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/sql
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/database/sql')
-rw-r--r--pkg/database/sql/media.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/database/sql/media.go b/pkg/database/sql/media.go
index b8203f3..e5ba517 100644
--- a/pkg/database/sql/media.go
+++ b/pkg/database/sql/media.go
@@ -139,6 +139,7 @@ func (self *MediaRepository) List(ctx context.Context, pagination *repository.Pa
Model(&Media{}).
Offset(pagination.Page * pagination.Size).
Limit(pagination.Size).
+ Where("path like '" + pagination.Path + "%'").
Order("created_at DESC").
Find(&medias)
@@ -257,7 +258,7 @@ func (r *MediaRepository) ListEmptyEXIF(ctx context.Context, pagination *reposit
WithContext(ctx).
Model(&Media{}).
Joins("left join media_exifs on media.id = media_exifs.media_id").
- Where("media_exifs.media_id IS NULL").
+ Where("media_exifs.media_id IS NULL AND media.path like '" + pagination.Path + "%'").
Offset(pagination.Page * pagination.Size).
Limit(pagination.Size).
Order("media.created_at DESC").
@@ -280,7 +281,7 @@ func (r *MediaRepository) ListEmptyThumbnail(ctx context.Context, pagination *re
WithContext(ctx).
Model(&Media{}).
Joins("left join media_thumbnails on media.id = media_thumbnails.media_id").
- Where("media_thumbnails.media_id IS NULL").
+ Where("media_thumbnails.media_id IS NULL AND media.path like '" + pagination.Path + "%'").
Offset(pagination.Page * pagination.Size).
Limit(pagination.Size).
Order("media.created_at DESC").