Skip to content

Thumbnails from server - #687

Merged
davivel merged 13 commits into
developfrom
thumbnails_from_server
Nov 3, 2014
Merged

davivel merged 13 commits into
developfrom
thumbnails_from_server

Conversation

@jabarros

Copy link
Copy Markdown
Contributor

No description provided.

@davivel davivel mentioned this pull request Oct 28, 2014

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field cannot be defined in this scope (static).

The OwnCloudClient depends on an OC Account; the ThumbnailsCache is a single instance for all the existing OC Accounts. "Saving" just the last needed client will imply problems.

Right now, this is causing the bug #691; the first time the app is installed, while the account is being created, the InitTask is triggered with a NULL account, resulting in mClient = null; subsequent tasks to generate thumbnails will do nothing because of this NULL value.

The changes needed are:

  • Move mAccount field from InitDiskCacheTask to ThumbnailGenerationTask; set it appropiately in its constructor.
  • get an OwncloudClient instance in the doInBackground method of ThumbnailGenerationTask, not in InitCacheTask

@tobiasKaminsky

Copy link
Copy Markdown
Contributor

So, hopefully I have done everything right with my new permissions.
@davivel Bugfix is included. But now everytime "doInBackground" from ThumbnailGenerationTask is executed a new mClient is created.

Is this necessary? (I am not into the internal behaviour yet)

@davivel

davivel commented Oct 30, 2014

Copy link
Copy Markdown
Contributor

It's a risk for performance, but that's something I will evaluate now with the battery of tests.

Anyway, we have a solution for that: swap to the newer SingleSessionOwnCloudClientManager in the OC Android library so that clients are not created every time, but reused for the same account.

@rperezb rperezb added this to the 2014-sprint-01-current milestone Nov 3, 2014
@davivel

davivel commented Nov 3, 2014

Copy link
Copy Markdown
Contributor

Seems that performance is good enough for the moment.

Anyway, we have some idea that probably would improve it; I'll tell you as soon as I find a while.

davivel added a commit that referenced this pull request Nov 3, 2014
Get remote thumbnails from server (OC8)
@davivel
davivel merged commit 183cd73 into develop Nov 3, 2014
@davivel
davivel deleted the thumbnails_from_server branch November 3, 2014 12:46
@tobiasKaminsky

Copy link
Copy Markdown
Contributor

Great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants