Add a way for the client to specify what metadata they're interested in

Bug #1616811 reported by James Henstridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
storage-framework (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Currently items are represented in the D-Bus API as a struct consisting of:

 * item_id (string)
 * parent_ids (array of string)
 * name (string)
 * etag (string)
 * type (enum)
 * metadata (dict)

We don't currently specify what should be in that dict: should it be a small set of standardised keys, or should it be everything the online service could present to the user?

Neither of these extremes are great: in the first case, it could mean that an application can't access the information it needs in order to operate with a particular provider. In the other, we're almost certainly sending much more data to the client than they need (and requesting a lot more data from the online service than needed). When doing folder listings, this overhead can add up quite quickly.

A few of the online services (at least Google and Microsoft) allow you to filter the returned metadata, so I propose following this lead. So for instance, the Metadata call would change from:

    Metadata(item_id) -> (item struct)
    Metadata(item_id, [list of keys]) -> (item struct)

So if the client passed ["size_in_bytes", "last_modified_time"] as the second argument, that would indicate to the provider that it should return at least those two items in the dict if available.

If an empty list of keys are sent, a provider could leave the metadata dict empty.

Changed in storage-framework (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.