diff options
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/world.c | 20 | ||||
-rw-r--r-- | wscript | 2 |
3 files changed, 27 insertions, 1 deletions
@@ -1,3 +1,9 @@ +lilv (0.24.9) unstable; + + * Make lilv_world_get() use translations + + -- David Robillard <d@drobilla.net> Sun, 17 May 2020 18:44:04 +0000 + lilv (0.24.8) stable; * Allow passing strings for URIs in Python API when unambiguous 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, @@ -12,7 +12,7 @@ from waflib.extras import autowaf # major increment <=> incompatible changes # minor increment <=> compatible changes (additions) # micro increment <=> no interface changes -LILV_VERSION = '0.24.8' +LILV_VERSION = '0.24.9' LILV_MAJOR_VERSION = '0' # Mandatory waf variables |