Public bug reported:

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.

** Affects: storage-framework (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1616811

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/storage-framework/+bug/1616811/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to