mirror of
https://github.com/samuelncui/yatm.git
synced 2026-11-08 04:18:03 +00:00
Remove the uncalled Library name search
Library.Search predated query-based Search and had no callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
80e15cd4de
commit
a6125e679d
1 file changed
-13
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user