Fix linking guessed tags

Since tag names are lower-cased the search must happen lower-cased, too.
This commit is contained in:
Eike Kettner 2021-01-02 01:18:43 +01:00
parent c0733ee538
commit a9ed0364d2

View File

@ -122,11 +122,13 @@ object RTag {
(idList, nameList) match {
case (Some(ids), _) =>
val cond =
T.cid === coll && (T.tid.in(ids) ||? nameList.map(names => T.name.in(names)))
T.cid === coll && (T.tid.in(ids) ||? nameList.map(names =>
T.name.inLower(names)
))
run(select(T.all), from(T), cond).query[RTag].to[Vector]
case (_, Some(names)) =>
val cond =
T.cid === coll && (T.name.in(names) ||? idList.map(ids => T.tid.in(ids)))
T.cid === coll && (T.name.inLower(names) ||? idList.map(ids => T.tid.in(ids)))
run(select(T.all), from(T), cond).query[RTag].to[Vector]
case (None, None) =>
Vector.empty.pure[ConnectionIO]