Mopidy 1.1 deprecated methods

Hi

Since mopidy v1.1 these methods are deprecated:

  • mopidy.core.LibraryController.search()
  • mopidy.core.PlaylistsController.filter()
  • mopidy.core.TracklistController.filter()
  • mopidy.core.TracklistController.remove()

For example: mopidy.core.TracklistController.remove()
Deprecated since version 1.1: Providing the criteria via kwargs.

What means kwargs?

I use HTTP JSON-RPC API:
$ curl -d ‘"{“method”:“core.tracklist.remove”,“jsonrpc”:“2.0”,“id”:205,“params”:[{“tlid”:[1234]}]}"’ http://192.168.0.102:6680/mopidy/rpc

What I should change? Or will it work with this command?

The filter() methods was already deprecated in 1.0. What’s new now is that passing the query through **kwargs is deprecated.

Using mopidy.core.TracklistController.remove() as an example from now on…

From a JSON-RPC perspective, this means that you’ll need to pass the query as an object either:

  • as the first positional argument
    • "params": [{"tlid": [1234]}]
  • as the named argument “criteria”. This is the recommended way.
    • "params": {"criteria": {"tlid": [1234]}}

What is no longer recommended is to pass each of the terms in your query as named arguments:

  • "params": {"tlid":[1234]}

If using Mopidy.js, with the old “by-position-only” calling convention:

  • remove({"tlid": [1234]}) works
  • remove(null, {"tlid": [1234]}) is deprecated

If using Mopidy.js, with the newer and future default “by-position-or-by-name” calling convention:

  • remove({"criteria": {"tlid": [1234]}}) works, and is the recommended way
  • remove([{"tlid": [1234]}]) works
  • remove([null, {"tlid": [1234]}]) is deprecated
  • remove({"criteria": null, "tlid": [1234]}}) is deprecated

Thanks! Now its clear