trannamtrung1st / elFinder.Net.Core

An elFinder backend connector with less magic code and more compatibility. This enables .NET Standard 2.0 projects to easily integrate elFinder functionalities.
Apache License 2.0
12 stars 8 forks source link

Inconsistent Volume order #21

Closed huwjeffries closed 2 years ago

huwjeffries commented 2 years ago

Sorry - another minor bug + suggested fix. In the demos, highlight Volume 2. Press refresh. The volumes are listed as: Volume 2 Volume 0 Volume 1 Volume 3 Volume 4 Go into a subfolder under Volume 2 and press refresh. The volumes are listed as: Volume 0 Volume 1 Volume 2 -> Subfolder Volume 3 Volume 4

The simplest fix would be to add an OrderBy on line 169 of Connector.cs: openResp.files = openResp.files.OrderBy(f => (f as BaseInfoResponse)?.name ?? string.Empty).ToList(); And make the files property setter public. There may be a more elegant place to put this with a bit of refactoring. Thanks.

trannamtrung1st commented 2 years ago

Hi @huwjeffries, good catch. Just fixed this issue in patch 1.4.1. Check it out.

trannamtrung1st commented 2 years ago

I didn't use OrderBy to maintain the original order of the Volumes list passed to the Connector. Therefore we can have a custom order if we want.