chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

Module less versatile due to OS feature prevention #230

Open oliversalzburg opened 6 years ago

oliversalzburg commented 6 years ago

imgcache.js disables Gallery integration on Android and backups on iOS. I actually want those features, but imgcache.js provides no means to control the behavior.

I made a crude change in our fork, which works for us for the time being, but I'd like to hear thought regarding this issue.

chrisben commented 6 years ago

I think what you're aiming to achieve can be controlled by setting the target directory of the cache, in order to use an OS backed up directory. You need to override the following setting:

ImgCache.options.cordovaFilesystemRoot

Look at the js file header for more details.

But maybe I didn't understand your exact requirement.

Le jeu. 6 sept. 2018 à 16:41, Oliver Salzburg notifications@github.com a écrit :

imgcache.js disables Gallery integration on Android and backups on iOS. I actually want those features, but imgcache.js provides no means to control the behavior.

I made a crude change in our fork https://github.com/fairmanager-cordova/imgcache.js/commit/d0c5cd2b4914bc28f8ae38eafcb7d15ec867ee98, which works for us for the time being, but I'd like to hear thought regarding this issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chrisben/imgcache.js/issues/230, or mute the thread https://github.com/notifications/unsubscribe-auth/AApdPoo2ffOL8qyww7MGEoPXuWs1Au3eks5uYVA9gaJpZM4WdT4M .

oliversalzburg commented 6 years ago

It doesn't really matter what folder you set, the library will always create a .nomedia file in the target directory, which prevents the contents from being indexed by the Media Scanner.

On iOS, the library will set the com.apple.MobileBackup key on the file system entry to prevent it from being backed up to iCloud.

I do not see a way to control that behavior currently. In case I misunderstood your suggestion, please let me know.

chrisben commented 6 years ago

I see now.

I will add an option to disable this behaviour soon, I hope by the end of the week.

oliversalzburg commented 6 years ago

Oh, wow. Awesome :) I'll be sure to check it out.

chrisben commented 6 years ago

Have a look at the new branch above, and let me know if that's what you were looking for. I'll merge it if that's ok.

oliversalzburg commented 6 years ago

@chrisben That looks awesome 👍

oliversalzburg commented 5 years ago

@chrisben Do you plan to merge that feature branch anytime soon? I would really like to use your official version and rebase my work on top.