feat(subsonic): allow search with MBID (#579)

* feat(search): use search2/3 query to additionally search track MBID

* feat(search): use strict equality for MBID search

don't compare substrings for now to reduce unwanted results based on
MBIDs

might also make search more efficient

* feat(db): add migration to create index on MBID

for MBID search

* tweak(search): remove unnecessary trim on query
This commit is contained in:
gabe
2025-05-26 14:38:25 +00:00
committed by GitHub
parent 19b707c5d4
commit 2d4111dfc5
3 changed files with 9 additions and 2 deletions

No files matched your search

+7
View File
@@ -77,6 +77,7 @@ func (db *DB) Migrate(ctx MigrationContext) error {
construct(ctx, "202501152036", migrateAlbumAddIndexOnParentID),
construct(ctx, "202502012036", migratePodcastEpisode),
construct(ctx, "202504132036", migratePodcast),
construct(ctx, "202505211202", migrateTrackAddIndexOnBrainzID),
}
return gormigrate.
@@ -840,3 +841,9 @@ func migratePodcastEpisode(tx *gorm.DB, _ MigrationContext) error {
PodcastEpisode{},
).Error
}
func migrateTrackAddIndexOnBrainzID(tx *gorm.DB, _ MigrationContext) error {
return tx.Exec(`
CREATE INDEX idx_tracks_brainz_id ON "tracks" (tag_brainz_id);
`).Error
}