From a6125e679df87591af8bf0b3f00ed678f9c3afd6 Mon Sep 17 00:00:00 2001 From: Samuel Cui Date: Sat, 31 Oct 2026 15:46:10 +0800 Subject: [PATCH] Remove the uncalled Library name search Library.Search predated query-based Search and had no callers. Co-Authored-By: Claude Opus 5.5 --- internal/library/file.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/internal/library/file.go b/internal/library/file.go index cdcbc2b..2256346 100644 --- a/internal/library/file.go +++ b/internal/library/file.go @@ -497,16 +497,3 @@ func listFileRowParents(tx *gorm.DB, id int64) ([]*File, error) { return result, nil } - -func (l *Library) Search(ctx context.Context, name string) ([]*File, error) { - // Search persisted identities before attaching compatibility projections. - rows := make([]*fileRow, 0, 4) - if r := l.readDB().WithContext(ctx).Where("name LIKE ?", "%"+name+"%").Order("name").Limit(100).Find(&rows); r.Error != nil { - return nil, fmt.Errorf("find files fail, %w", r.Error) - } - files := fileViews(rows) - if err := hydrateFileViews(l.readDB().WithContext(ctx), files...); err != nil { - return nil, fmt.Errorf("hydrate files fail, %w", err) - } - return files, nil -}