Allow artist tags that can't have mbid (composer, lyricist, etc.) to fallback on artists which have mbid (track artists, release artists)
This commit is contained in:
@@ -45,7 +45,10 @@ Artist::getByName(Session& session, const std::string& name)
|
||||
{
|
||||
session.checkSharedLocked();
|
||||
|
||||
Wt::Dbo::collection<Artist::pointer> res = session.getDboSession().find<Artist>().where("name = ?").bind( std::string{name, 0, _maxNameLength} );
|
||||
Wt::Dbo::collection<Artist::pointer> res = session.getDboSession().find<Artist>()
|
||||
.where("name = ?").bind(std::string {name, 0, _maxNameLength})
|
||||
.orderBy("LENGTH(mbid) DESC"); // put mbid entries first
|
||||
|
||||
return std::vector<Artist::pointer>(res.begin(), res.end());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user