thielepaul / photoprism-mobile

Flutter App for PhotoPrism
GNU General Public License v3.0
892 stars 72 forks source link

Perform bulk uploads as a series of smaller requests #80

Closed czan closed 3 years ago

czan commented 3 years ago

When I upload a batch of photos/videos in one hit I keep hitting the max request size limit on my nginx reverse proxy. I don't want to raise the limit, and it seems like doing bulk uploads in one big request causes other issues (e.g. #72).

As far as I can tell, the upload process blocks the UI, so this PR assumes that and doesn't try to handle multiple batches being started at different times. I think the class needs a more significant refactor if we want to handle that case. The error case is also a bit blunt, and doesn't provide useful feedback in the partial failure case, when some photos succeeded and others failed. There's a lot of room for improvement, but I wanted to start with the minimal changes that would work for my use.

Looking at the PhotoPrism server code I'm not expecting any problems, and in my manual testing things have worked as expected.

czan commented 3 years ago

Sorry about that. I've added the type, so flutter analyze now reports "No issues found!" locally. Hopefully CI will pass, too!

thielepaul commented 3 years ago

Probably the manual upload should be refactored to share as much code as possible with the automatic upload. Then, it would not need to block the UI and would resume in background if you close the app.