Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameters to syncing binary images to decrease size #134

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

leiyiz
Copy link
Contributor

@leiyiz leiyiz commented Jun 13, 2019

adding ability to sync reduced-size image attachments for server and redownload all reduced-size images if ever wanted

depends on:
odk-x/sync-endpoint#20

odk-x/androidlibrary#127

@getodk-bot
Copy link

Can one of the admins verify this patch? Also need an authorization to run tests.

@wbrunette
Copy link
Member

runtests

@clarlars clarlars self-requested a review July 19, 2019 21:24
@clarlars
Copy link
Contributor

runtests

1 similar comment
@clarlars
Copy link
Contributor

runtests

@wbrunette wbrunette changed the title Development Add parameters to syncing binary images to decrease size Jul 22, 2019
URI instanceFilesDownloadUri = wrapper.constructInstanceFileBulkDownloadUri(serverInstanceFileUri, instanceId);

ArrayList<OdkTablesFileManifestEntry> entries = new ArrayList<OdkTablesFileManifestEntry>();
for (CommonFileAttachmentTerms cat : filesToDownload) {
OdkTablesFileManifestEntry entry = new OdkTablesFileManifestEntry();
entry.filename = cat.rowPathUri;
entry.reduceFileSize = reduce ? "t" : "f";
Copy link
Member

Choose a reason for hiding this comment

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

I strongly recommend to use "true" and "false" instead of "t" and "f" as you can then simply use the Boolean class to convert the parameters. Consistency is important and if it's meant as true and false then use true and false.

@wbrunette
Copy link
Member

runtests

URI instanceFilesDownloadUri = wrapper.constructInstanceFileBulkDownloadUri(serverInstanceFileUri, instanceId);

ArrayList<OdkTablesFileManifestEntry> entries = new ArrayList<OdkTablesFileManifestEntry>();
for (CommonFileAttachmentTerms cat : filesToDownload) {
OdkTablesFileManifestEntry entry = new OdkTablesFileManifestEntry();
entry.filename = cat.rowPathUri;
entry.reduceFileSize = reduce ? "t" : "f";
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, OdkTablesFileManifestEntry is one of the classes found in the odk-rest-interface jar. In order for this change to work, the odk-rest-interface jar will need to be packaged with the change to OdkTablesManifestEntry in the sync-endpoint and put into androidlibrary under the androidlibrary/androidlibrary_lib/libs directory.

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