Skip to content

Feature uploadsubfolders#35

Merged
AndyScherzinger merged 11 commits into
masterfrom
feature_uploadsubfolders
Jun 27, 2016
Merged

Feature uploadsubfolders#35
AndyScherzinger merged 11 commits into
masterfrom
feature_uploadsubfolders

Conversation

@Spacefish

Copy link
Copy Markdown
Member

My InstantUpload folder is pretty crowded with thousands of pictures.. so i programmed a feature, which upload the pictures into subfolders based on year / month.
My folder got too so big, such that opening it takes quite a lot of time..

Comment thread res/xml/preferences.xml
android:title="@string/prefs_instant_upload_path_title"
android:key="instant_upload_path" />
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
android:title="@string/prefs_instant_upload_path_use_subfolders_title"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please only lines with 80 chars, this makes review on github a lot easier.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tobiasKaminsky 120 is fine with me ;) Since this is still enough for the files changed tab :D So I would vote to go for 120 line length. @przybylski

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Longer line would be great I would vote to stick to how android code is written, which is 100 lines.
https://source.android.com/source/code-style.html#limit-line-length

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tobiasKaminsky what do you think? I am with @przybylski on this, so I also vote for 100 💯

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

100 is also fine for me. I do not know who said 80 back on owncloud, but if 100 is still visible in changes tab on github everything is fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I introduced 80 chars limit. I don't recall why :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think Github would also work with 120, not sure though...

@tobiasKaminsky

Copy link
Copy Markdown
Member

Thanks for this feature!
Can you implement this also for video? Maybe it is not your use case, but it is inconsistent to have it only for images. But I think it should be two independent settings.

@Spacefish

Copy link
Copy Markdown
Member Author

implemented your feedback. It now works for videos as well.
I am a littlebit unsure if "use subfolders" is the correct name for the prefence setting.. Maybe we should use "Organize uploads into folders based on date" or something like this?
I am not an native english speaker, so i am unsure if this sounds correct.

@AndyScherzinger

Copy link
Copy Markdown
Member

pinging @jancborchardt for input regarding the mechanism and UX. I am unsure if and how this should work. I do like the idea of having more than simply one hard coded folder to where all my photos get uploaded but I am also not sure how to solve this since would use hierarchies as in folders for the year with subfolders in them. Since it is an optional setting I don't care too much about arguing about if and how to do this. Besides that I usually group my photos based on events like a vacation within the corresponding year's folder like "2016/05-Rome" which is not something we can implement since this is something for Google Photos server farm...

@AndyScherzinger

Copy link
Copy Markdown
Member

@jancborchardt In general my question here is probably how to handle and deal with additional app settings being introduced. #notAnExpert

@Spacefish

Copy link
Copy Markdown
Member Author

@AndyScherzinger i thought about this too. But opted to hardcode the path. My initial thought was to offer placeholders, so the user is able to use his own subfolder scheme based on different variables. However the current folder selections isn´t done by editing a string, and furthermore it might get to complicated to know all that placeholders / write a correct string.
If someone wants another scheme, we could open a popup with multiple schemes to choose from, once the user clicks on the preference. However as a initial version i opted for one single scheme.

I don´t have a lot of experience in android app development, this is probably the 3rd time i looked into an android app / changed something, so i didn´t want to make my life to complicated ;)

@tobiasKaminsky

Copy link
Copy Markdown
Member

@AndyScherzinger this has been discussed on owncloud, ref: owncloud/android#1421

I think it is a good approach. If we see that another mechanism for subfolder is needed we can extend this setting.
@jancborchardt ok for you?

@AndyScherzinger

Copy link
Copy Markdown
Member

Perfectly fine with me :)

Comment thread res/values/strings.xml
<string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
<string name="prefs_instant_upload_path_title">Upload path</string>
<string name="prefs_instant_upload_path_use_subfolders_title">Use subfolders</string>
<string name="prefs_instant_upload_path_use_subfolders_summary">Store in subfolders based on year and month</string>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

year & month: plural or singular ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

both, as year and month refers to a single subfolder, but multiple subfolders are created.

@AndyScherzinger

Copy link
Copy Markdown
Member

Hmm, I would rather go for test and merge on master and put that into the Google Play beta and after two weeks release to stable. This is totally aside from the "real" beta you publish on f-droid.

@tobiasKaminsky tobiasKaminsky added this to the Nextcloud App 1.1.0 milestone Jun 21, 2016
@tobiasKaminsky

Copy link
Copy Markdown
Member

@przybylski is the code now fine for you?

}
try {
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy" + OCFile.PATH_SEPARATOR + "MM" + OCFile.PATH_SEPARATOR, Locale.ENGLISH);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO it should be Locale.getDefault()

@jancborchardt

Copy link
Copy Markdown
Member

Just a question regarding the first iteration – is this similar to how Dropbox and Google Drive or other solutions do it, so we don’t do something entirely different which people will not be used to?

@AndyScherzinger

Copy link
Copy Markdown
Member

@jancborchardt they don't offer this at all because they don't have to due to a smart clustering. The UI is taking care of displaying clusters of photos as in time, location, people, etc.
So they have a smart, analyzing server side and an (unknown) nice API to access the photo buckets based on these criteria. Nextcloud is a storage solution so we live and breathe folder structures as the only available element to provide structures so it makes sense to offer this but you will probably never see it in the other, mentioned apps.

@jancborchardt

Copy link
Copy Markdown
Member

they don't offer this at all because they don't have to due to a smart clustering. The UI is taking care of displaying clusters of photos as in time, location, people, etc.

Right, like iOS does as well in photos. We could do this as well instead of imposing a hard structure via folders, right?

@AndyScherzinger

Copy link
Copy Markdown
Member

Theoretically, yes. This would then mean that the client (web, Android, etc.) would need to be implement such a view the tricky part is we have an one-for-all approach, we don't just do media we do any kind of line, so it is hard to decide when to cluster (images) and when not to.
Even then "having a folder per month" might still be legit simply because people might want to have this folder structure, but I can't say because I do grouping topic based most of the time and I create a folder per year and change the instant upload folder, so I also kind of use this feature, but atm by hand.

@Spacefish

Copy link
Copy Markdown
Member Author

A indexing solution on the server with an API would be nice. However this is far off IMHO and not related to the android app currently, server infrastructure has to be in place beforehand.
I would image the server to do automatic tagging of photos, based on GPS location and "time based clusters". Such that photos from one trip, end up in the same cluster.
To be performant, one could use elastic search and such to make this tags / metainformation easily queriable / searchable. Putting the pictures in subfolders would not hurt this concept at all.

@jancborchardt

Copy link
Copy Markdown
Member

the tricky part is we have an one-for-all approach, we don't just do media we do any kind of line, so it is hard to decide when to cluster (images) and when not to.

I’d argue that this is what we’re here to solve though. :) cc @LukasReschke @schiessle for the server.

@Spacefish the difficult part about such a feature is that when it’s in, it’s hard to remove. As soon as we have a structure, it will likely need to be in forever. And especially here I’m very hesitant to include it since it adds a lot of complexity and levels for when you just want to have a few photos synced.

@jancborchardt

Copy link
Copy Markdown
Member

A giant drawback of this as well is that when you have a vacation which is on the end+beginning of a month or year (such as new year festivities), the pictures will be in completely different folders. That makes no sense at all. ;)

@Spacefish

Spacefish commented Jun 23, 2016

Copy link
Copy Markdown
Member Author

Yes, there are pro and cons, the solution to put pictures in subfolders based on month, is the same that shotwell choose to order their imported pictures by default.
We can continue bikeshedding ( http://bikeshed.com/ ) or merge the feature. The time required to talk about things like whether we should should pass date/time to a helper, use System.CurrentTime directly, whether a comment is to obvious, or the max length of lines, required was much higher than the actual development time.
I tried to solve a problem i had, 10k pictures in one folder, which broke the WebUI aswell as the App.
Please either merge it or close the PR.

@jancborchardt

Copy link
Copy Markdown
Member

We can continue bikeshedding or merge the feature. The time required to talk about things […] was much higher than the actual development time.

Sorry about that, we really value your contribution. But this is not a simple bikeshedding discussion – while it might help your specific case, it’s something which will actually impair the experience for people who just have a few pictures.

You might have also read recently »Rule #1 of open-source: no is temporary, yes is forever.« Meaning that if we »just merge the feature« right now, then it will be incredibly hard to remove it in the future should we reconsider. Discussion time vs development time is never an argument for any sensible software. ;)

With Nextcloud we really want to provide a product which is very easy and fun to use. That often means fussing over details, and discussing stuff. Since this feature wasn’t discussed or specced prior to this implementation, we of course have to weigh it now.

@jancborchardt

Copy link
Copy Markdown
Member

(Btw @Spacefish I just saw you are based in Stuttgart – you should meet up with @karlitschek and @schiessle some time as they’re there too! Probably time to get a Stuttgart Nextcloud meetup going. ;)

@tobiasKaminsky

Copy link
Copy Markdown
Member

As it is an optional feature I think it is not such a problem.
It as in enhancement and an opportunity for the user and not something they are forced to...

A giant drawback of this as well is that when you have a vacation which is on the end+beginning of a month or year (such as new year festivities), the pictures will be in completely different folders.

This is a very rarely scenario and on the opposite site I could say: what if the folder gets > 10k images and is not managable by the user. This feature is, at least for me, a slightly enhancement and is not that strict as the user still can move the files around, like @AndyScherzinger and me are doing it: regular photos in year/month and special images are moved to a meaningful subfolder.

BTW: As this is the second PR (after #4) that is heavily discussed after developing we should really keep this schema: feature request/idea -> discuss -> implement -> testing -> merging. Of course it can happen that a requirement changes, but the features should be so small that it happens rarely.

So long speech, I would merge this, but by default the behaviour remains the same as now.
And on the long term we can try to enhance this by an intelligent server-side sorting system.
(As said before this is nothing that the app should care about)

@AndyScherzinger

Copy link
Copy Markdown
Member

I second @tobiasKaminsky's vote here. The standard way is still the standard behavior and in this case I don't see any problems since this feature isn't a one way street and could be removed whenever we come up and ship a smarter processing and wouldn't run into (technical) problems.

@AndyScherzinger

Copy link
Copy Markdown
Member

@jancborchardt we would like to get some final feedback / vote because this is the last open PR for the beta release 🚀

@LukasReschke

Copy link
Copy Markdown
Member

Seconding @AndyScherzinger and @tobiasKaminsky here. LGTM.

@jancborchardt

Copy link
Copy Markdown
Member

Ok, let’s try this out. Can’t be that bad since it’s optional and apparently lots of people want it. Not going to be against that then ;) 👍 Wording is fine too.

@AndyScherzinger
AndyScherzinger merged commit c875bba into master Jun 27, 2016
@AndyScherzinger
AndyScherzinger deleted the feature_uploadsubfolders branch June 27, 2016 08:45
@AndyScherzinger

Copy link
Copy Markdown
Member

Thanks for the feedback @jancborchardt

@LukasReschke next up we will prepare the master branch for a Play store release for the beta channel :) @tobiasKaminsky and I will prepare everything for you to simply build and deploy :)

@LukasReschke

Copy link
Copy Markdown
Member

@LukasReschke next up we will prepare the master branch for a Play store release for the beta channel :) @tobiasKaminsky and I will prepare everything for you to simply build and deploy :)

🚀

@jancborchardt

Copy link
Copy Markdown
Member

@Spacefish @AndyScherzinger @tobiasKaminsky sorry about the longer discussion btw – while the basic points regarding design of course stand, I must have missed that this is an optional subsetting. :)

@AndyScherzinger

Copy link
Copy Markdown
Member

No worries, thanks for the feedback. All new features are now on master and we are preparing the beta release :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants