Skip to content

Commit

Permalink
Merge pull request #569 from BloomBooks/BL13916_LicenseFilter
Browse files Browse the repository at this point in the history
Use exact match for license filtering (BL-13916)
  • Loading branch information
hatton authored Sep 24, 2024
2 parents 1988642 + d465cfc commit 952aab4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/connection/LibraryQueryHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,6 @@ export function constructParseBookQuery(
switch (facetLabel) {
case "title":
case "copyright":
case "license":
case "country":
case "publisher":
case "originalPublisher":
Expand All @@ -1228,8 +1227,16 @@ export function constructParseBookQuery(
case "branding":
if (facetLabel === "branding")
facetLabel = "brandingProjectName";
// partial match
params.where[facetLabel] = regex(facetValue);
break;
case "license":
// exact match
params.where.license = {
$regex: `^${facetValue}$`,
...caseInsensitive,
};
break;
case "uploader":
params.where.uploader = {
$inQuery: {
Expand Down

0 comments on commit 952aab4

Please sign in to comment.