diff options
author | Jens Georg <mail@jensge.org> | 2022-07-15 17:14:33 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2022-08-07 19:15:50 +0200 |
commit | 6ba484cf590319d44e6150b12d4d12cb9e11a943 (patch) | |
tree | fa037ea12ed845b5b1e51266382032c61fc9a62e /examples | |
parent | 98da362250dde377939d9d13110e2b5d6a98aee8 (diff) | |
download | gupnp-6ba484cf590319d44e6150b12d4d12cb9e11a943.tar.gz |
examples: Fix browse.js for removed API
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/browse.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/examples/browse.js b/examples/browse.js index 862c15a..2e750eb 100755 --- a/examples/browse.js +++ b/examples/browse.js @@ -40,12 +40,12 @@ const Soup = imports.gi.Soup; const MEDIA_SERVER = "urn:schemas-upnp-org:device:MediaServer:1"; const CONTENT_DIR = "urn:schemas-upnp-org:service:ContentDirectory"; -function _on_browse_ready (cd, action) +function _on_browse_ready (cd, res) { + var action = cd.call_action_finish(res) let foo = [GObject.TYPE_STRING, GObject.TYPE_UINT, GObject.TYPE_UINT, GObject.TYPE_UINT]; - let [a, b] = cd.end_action_list (action, ["Result", "NumberReturned", "TotalMatches", "UpdateID"], foo); - cd.unref(); + let [a, b] = action.get_result_list(["Result", "NumberReturned", "TotalMatches", "UpdateID"], foo); if (a) { print ("Number Returned:", b[1]); @@ -58,14 +58,11 @@ function _on_proxy_available (control_point, proxy) { print ("-> Proxy available!", proxy.get_friendly_name ()); var cd = proxy.get_service (CONTENT_DIR); - // FIXME: This needs probably fixing on C side - cd.ref(); - print ("-> Start browsing of", proxy.get_friendly_name ()); - cd.begin_action_list ("Search", + var action = GUPnP.ServiceProxyAction.new_from_list ("Search", ["ContainerID", "Filter", "StartingIndex", "RequestedCount", "SortCriteria", "SearchCriteria"], - ["0", "*", 0, 10, "+dc:title", "upnp:class derivedFrom \"object.item\""], - _on_browse_ready) + ["0", "*", 0, 10, "+dc:title", "upnp:class derivedFrom \"object.item\""]) + cd.call_action_async (action, null, _on_browse_ready) } function _on_proxy_unavailable (control_point, proxy) { |