ARK-Builders/ARK-Navigator

Background indexing

Opened this issue · 3 comments

It would be great, if a user could switch to other activities with the app while huge folders are being indexed.
E.g. trigger indexing of other folders or tag resources. It can happen that the user tags a resource, which is still not indexed.
Then we need to postpone modification of the storage, since we don't know the resource's id.
This means, beside of indexing queue we also need to create tagging queue.

Resources which are not indexed yet, but already tagged by the user — must be prioritized in indexing queue.

@mdrlzy Probably, we should re-think this issue: let's just allow user use Navigator without waiting while all previews are generated. I.e. non-blocking previews generation. Later, it will be possible to separate other stages of indexing.

Step 1: non-blocking previews generation.

  • When resources ids are known, grid items could be mocked and user should be allowed scroll Resource Grid
  • Resource stubs should be marked by endless spinner if preview for the resource is not ready yet
  • Gallery could be made available too, also with endless spinner on scheduled previews
  • Gallery screen: user should be able to see tags and/or see details of the resource
  • Resource Grid screen: user should be able to query resources even if they don't have preview yet

Step 2: non-blocking metadata extraction.
Depending on selected sorting criteria, ordering of resources can depend on metadata. So if metadata is not computed yet, we can't sort resources, in some cases.

Step 3: non-blocking indexing.
If we have a collection of resources, where some resources lack ids, it becomes impossible to locate them using tags or display their scores. Versions will not be possible, too. We need to be able to update queries in a way which is not confusing for the user.

Step 4: app-independent indexing.
It would be awesome to decouple indexing, metadata extraction and previews generation from particular app (Navigator, Shelf, Memo, etc.) and do in background once for all dependent apps. This could be supported by implementing Android service which would serve all ARK apps with index and storages.

Step 5: user-dependent prioritization of processing queues
If an id or metadata are missing for a resource which is subject to some user's action (tagging or something else), we should prioritize it's processing (i.e. indexing or metadata extraction).

Opening a resource in Gallery view should prioritize its processing in the queue, too.