ResourceMetaExtra substructure of ResourceMeta introduced. This field is used to store dynamically-determined data which depends on kind of ResourceMeta (like video, documents, images etc.)
Previews are implemented using global singleton object and their generation is triggered during indexing. This has to be changed in future (see #115). We store generated previews in cache folder so far (this will be changed upon implementation of persisted/replicated cache). For images we don't generate previews, but just use themselves. For any kind of resource, besides preview, thumbnail is also generated which is preview scaled down to 72x108 and stored in separate folder. Existence of preview/thumbnail for given resource is done prepending constant path to its id.
What needs to be finished prior to merge into main:
Room structures for storing ResourceMetaExtra must be verified: ResourceExtra and ResourceWithExtra
Previews and thumbnails generation should be verified as well
Extra text snippets should be overlayed for videos and PDFs (see method draw() in VideoMetaExtra and DocumentMetaExtra)
Also would be good:
* Previews for videos (#33) is what gave name to this PR, but we could finish it later actually* Make sortings in resources grid use ResourceMeta fields size and modified instead of querying file system* Verify coroutines for loading thumbnails (see usage of ThumbnailTarget)
ResourceMetaExtra
substructure ofResourceMeta
introduced. This field is used to store dynamically-determined data which depends onkind
ofResourceMeta
(like video, documents, images etc.)Previews are implemented using global singleton object and their generation is triggered during indexing. This has to be changed in future (see #115). We store generated previews in cache folder so far (this will be changed upon implementation of persisted/replicated cache). For images we don't generate previews, but just use themselves. For any kind of resource, besides preview, thumbnail is also generated which is preview scaled down to 72x108 and stored in separate folder. Existence of preview/thumbnail for given resource is done prepending constant path to its
id
.What needs to be finished prior to merge into main:
ResourceMetaExtra
must be verified:ResourceExtra
andResourceWithExtra
draw()
inVideoMetaExtra
andDocumentMetaExtra
)Also would be good:
* Previews for videos (#33) is what gave name to this PR, but we could finish it later actually* Make sortings in resources grid useResourceMeta
fieldssize
andmodified
instead of querying file system* Verify coroutines for loading thumbnails (see usage ofThumbnailTarget
)