1
0
Fork 0

Match case-insensitively and with prefix instead of full match.

master
Icedream 2021-02-28 18:41:12 +01:00
parent 647db860b7
commit 4316443b70
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 2 additions and 2 deletions

View File

@ -179,9 +179,9 @@ func (m *manager) GetTrackByArtistAndTitle(artist, title string, withCoverFile b
db = db.Preload("CoverFile") db = db.Preload("CoverFile")
} }
err = db. err = db.
Where("artist = @artist AND title = @title", Where("artist = @artist AND title COLLATE UTF8_GENERAL_CI LIKE @title",
sql.Named("artist", artist), sql.Named("artist", artist),
sql.Named("title", title)). sql.Named("title", title+"%")).
Find(result).Error Find(result).Error
return return
} }