1
0
Fork 0

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

liquidsoap-2.2
Icedream 2021-02-28 18:41:12 +01:00
parent 59818d3dda
commit 30f855f1ed
Signed by: icedream
GPG Key ID: 468BBEEBB9EC6AEA
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")
}
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("title", title)).
sql.Named("title", title+"%")).
Find(result).Error
return
}