Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

add extractArchive bool parameter: #48

Closed
wants to merge 2 commits into from

Conversation

revolunet
Copy link

This is allows to sync non-zip files too :

  • make it possible de specify non-zip files in sync method
  • backup the destination file in the specified location

(iOS only)

ex:

var sync = ContentSync.sync({
    src: 'http://path/to/video.mp4',
    // unique name
    id: 'episode/42/video.mp4',
    // cachable
    type: 'local',
    // Not a zip
    extractArchive: false
});

Some remarks/questions :

  • why not using hash objects to pass parameters from plugin JS api to the native APIs, instead of long list of parameters ? (is there any cordova plugin boilerplate using this?)
  • the copyRootApp and copyCordovaAssets should imho be a separate method for this plugin, for example : ContentSync.copyRootApp(destination)

@revolunet
Copy link
Author

/cc @denisbabineau

@mwbrooks
Copy link
Collaborator

Before merging this, we will want to have an Android and WP implementation. We are trying to be strict with ensuring that this is a cross-platform plugin with parity between Android, iOS, and WP.

Personally, I'm reluctant to continue adding features to this plugin. If we consider moving forward with this, then can we assume that all files that do have a application/zip mime-type are standard files? That way we can avoid the additional option parameter.

@purplecabbage
Copy link
Member

Why not just sync files, and if they are zip files unzip them ... not sure why you would need an extra option.

@revolunet
Copy link
Author

thanks, agree :)

 - if content-type=application/zip or file ends with .zip
 - backup the destination file in the specified location
@imhotep
Copy link
Collaborator

imhotep commented Jul 29, 2015

@revolunet what about ContentSync.download?

@revolunet
Copy link
Author

yes the problem is that this one doesnt check for file existence before downloading :)

@revolunet
Copy link
Author

removed the extractArchive parameter in favor of file type detection, based on server content-type and file extension

@revolunet revolunet closed this Oct 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants