Skip to content

Commit

Permalink
gs-appstream: Fix querying for language support
Browse files Browse the repository at this point in the history
Due to a bug in libxmlb (I’m currently on version 0.3.3), using two
predicates sequentially doesn’t seem to work. Work around that by
combining the predicates into a single one with an `and` operator.

hughsie/libxmlb#95

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
  • Loading branch information
pwithnall committed Aug 13, 2021
1 parent 8cc6770 commit 1577a51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gs-appstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ gs_appstream_refine_app (GsPlugin *plugin,

/* @variants includes @tmp */
for (gsize i = 0; variants[i] != NULL; i++)
xb_string_append_union (xpath, "languages/lang[text()='%s'][@percentage>50]", variants[i]);
xb_string_append_union (xpath, "languages/lang[(text()='%s') and (@percentage>50)]", variants[i]);

if (xb_node_query_text (component, xpath->str, NULL) != NULL)
gs_app_add_kudo (app, GS_APP_KUDO_MY_LANGUAGE);
Expand Down

0 comments on commit 1577a51

Please sign in to comment.