GSoC:2008 Collections 2.0 Query API proposal

Erik Massop edited this page Nov 4, 2017 · 1 revision

Proposed Query API

In the new API ordering is done using the order collections operator. Limiting is done using the limit collections operator.

xmmsc_coll_query_mediaset_{id,info}s are provided only for convenience. They could also be achieved using xmmsc_coll_query_medialist_{id,info}s having applied order[type=id,order=ASC](mediaset(coll)) to the original collection.

Getting ids

  • xmmsc_coll_query_medialist_ids (conn, coll) - one id per entry
  • xmmsc_coll_query_mediaset_ids (conn, coll) - every id once, ordered ascending by id

Getting metadata

  • xmmsc_coll_query_medialist_infos (conn, coll, fetch) - one row per entry
  • xmmsc_coll_query_mediaset_infos (conn, coll, fetch) - every id once, ordered ascending by id
  • xmmsc_coll_query_clustered_infos (conn, coll, fetch, clusterby) - one row in recursive dicts

Conditional fetching

These fetch one row per entry of coll1, if coll1 is a medialist, otherwise of coll2. This is useful for inserting/appending collections to playlists and for using the same window for showing mediaset (which need additional order-operators) and medialists.

  • xmmsc_coll_query_ids_if_medialist (conn, coll1, coll2)
  • xmmsc_coll_query_infos_if_medialist (conn, coll1, coll2, fetch)

For compatibility

  • xmmsc_coll_query_ids (conn, coll, order, limit_start, limit_len) - legacy-style query_ids
  • xmmsc_coll_query_infos (conn, coll, order, limit_start, limit_len, fetch, group) - legacy style query_infos
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.