summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-05-17 20:49:46 +0200
committerDavid Robillard <d@drobilla.net>2020-05-17 20:49:46 +0200
commitb3438131f4bff67d56243bac85371c03a86bf53b (patch)
treedc1c34ab1ae1024057306ee08113fd708185f911 /src
parent20f2351a859568ca87bf71ef48a9ec4441c156f3 (diff)
downloadlilv-b3438131f4bff67d56243bac85371c03a86bf53b.tar.gz
lilv-b3438131f4bff67d56243bac85371c03a86bf53b.tar.bz2
lilv-b3438131f4bff67d56243bac85371c03a86bf53b.zip
Make lilv_world_get() use translations
Diffstat (limited to 'src')
-rw-r--r--src/world.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/world.c b/src/world.c
index 22d165a..65cffd4 100644
--- a/src/world.c
+++ b/src/world.c
@@ -240,6 +240,26 @@ lilv_world_get(LilvWorld* world,
const LilvNode* predicate,
const LilvNode* object)
{
+ if (!object) {
+ // TODO: Improve performance (see lilv_plugin_get_one)
+ SordIter* stream = sord_search(world->model,
+ subject ? subject->node : NULL,
+ predicate ? predicate->node : NULL,
+ NULL,
+ NULL);
+
+ LilvNodes* nodes =
+ lilv_nodes_from_stream_objects(world, stream, SORD_OBJECT);
+
+ if (nodes) {
+ LilvNode* value = lilv_node_duplicate(lilv_nodes_get_first(nodes));
+ lilv_nodes_free(nodes);
+ return value;
+ }
+
+ return NULL;
+ }
+
SordNode* snode = sord_get(world->model,
subject ? subject->node : NULL,
predicate ? predicate->node : NULL,