Skip to content

Remote folder size#1655

Merged
davivel merged 6 commits intomasterfrom
folderSize
Aug 22, 2016
Merged

Remote folder size#1655
davivel merged 6 commits intomasterfrom
folderSize

Conversation

@tobiasKaminsky
Copy link
Copy Markdown
Contributor

Folder size is now shown by remote computed folder size.

@jabarros
Copy link
Copy Markdown
Contributor

LGTM

@tobiasKaminsky
Copy link
Copy Markdown
Contributor Author

@LukeOwncloud @AndyScherzinger do you want to do a code review?

@AndyScherzinger
Copy link
Copy Markdown
Contributor

Looks good to me 👍

file.setCreationTimestamp(remote.getCreationTimestamp());
file.setFileLength(remote.getLength());
if (remote.getMimeType().equalsIgnoreCase("DIR")){
file.setFileLength(remote.getSize());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, I almost missed this part, that's why I thought it couldn't be working.

@PVince81 , do you recall what's the minimum server version including the property oc:size ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure, could be OC 6 or OC 7. That property has been there forever... But it's only on folders as far as I remember, because files have "getcontentlength" but folders don't have that one officially.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, you are right, that's what we need, the folders. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am always trying to hide the important things ;) ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LOL

Was checking the library, we explicitly request the oc:size property from owncloud/android-library#55 . We should make some minimum test with server 8.0.

Also would be wise to check what minimum OC server we grant the app works with. Do you recall it, @rperezb ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@davivel that's a good question!
For sure, I recall that we don't support oc4, I remember that the entrypoint changed that time (LOL), having said that, I will go with what we support as platform, we are about to stop supporting oc7 https://github.com/owncloud/core/wiki/Maintenance-and-Release-Schedule
@MTRichards is the one

@davivel
Copy link
Copy Markdown
Contributor

davivel commented May 25, 2016

With OC server 8.0.12 works fine.

With OC server 7.0.14 all folders show 0B as size. Server 7 is ending its life cycle, but we should support it.

Ideas to handle it:

  • in the android-library repo, change the default value of WebDavEntry#mSize to -1, instead of 0;
  • in this PR, when size is < 0, hide the size in the list of files;
  • in this PR, when server version is < 8.0, hide the option to sort by size; OR just leave it there, and let the folders are sorted according to the -1, maybe not so bad

@tobiasKaminsky
Copy link
Copy Markdown
Contributor Author

tobiasKaminsky commented May 25, 2016

I think option 3 is ok as the user still can sort all files by size.
Addition: show sorting possibility, but use -1 for eac folder.

@rperezb
Copy link
Copy Markdown

rperezb commented May 27, 2016

Having in mind that oc7 is not being supported any more, I agree with @tobiasKaminsky

@davivel
Copy link
Copy Markdown
Contributor

davivel commented May 27, 2016

Having in mind that oc7 is not being supported any more

If that's the case, maybe we don't need the special cases. I'm not sure about server 8.0.0, but 8.0.12 is working correctly. Is it worth that we add special handling for possible differences between minor versions?

@davivel
Copy link
Copy Markdown
Contributor

davivel commented May 27, 2016

Yes, checking https://github.com/owncloud/core/wiki/Maintenance-and-Release-Schedule seems that 7.0.15 dies this current month

@rperezb
Copy link
Copy Markdown

rperezb commented May 27, 2016

@davivel 3 days...

@tobiasKaminsky
Copy link
Copy Markdown
Contributor Author

If OC7 is not supported any longer then we can omit every check for the version, which makes the code less complicated 👍

@davivel
Copy link
Copy Markdown
Contributor

davivel commented Jul 13, 2016

Recovering focus on this.

Works with all the maintained versions of server, so 👍 from code perspective.

Unfortunately, there's too much already for 2.1.0, so needs to go to 2.2.0.

@jesmrec , ping us before testing to rebase.

@jesmrec
Copy link
Copy Markdown
Collaborator

jesmrec commented Aug 16, 2016

@davivel, i'm going to start to work with this PR. If you can rebase it...

@davivel
Copy link
Copy Markdown
Contributor

davivel commented Aug 16, 2016

Sure, in a minute.

@davivel
Copy link
Copy Markdown
Contributor

davivel commented Aug 16, 2016

@jesmrec , rebased.

@davivel davivel force-pushed the folderSize branch 2 times, most recently from ffa1e92 to f643460 Compare August 22, 2016 11:24
@davivel
Copy link
Copy Markdown
Contributor

davivel commented Aug 22, 2016

All is ready -> in

@davivel davivel merged commit d671e8e into master Aug 22, 2016
@davivel davivel deleted the folderSize branch August 22, 2016 13:49
@davivel davivel modified the milestones: 2.1.1, 2.2.0 Aug 29, 2016
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.

7 participants