nextcloud / ios

📱 Nextcloud iOS App
https://itunes.apple.com/us/app/nextcloud/id1125420102
GNU General Public License v3.0
1.99k stars 884 forks source link

Reversion: FIles do not sort in sequential order #3161

Closed biggreenogre closed 2 days ago

biggreenogre commented 2 weeks ago

How to use GitHub


Steps to reproduce

  1. Open Nextcloud from IOS home screen
  2. Select a folder
  3. View file/folder list

Expected behaviour

FIles and folders should display in sequential order e.g. files MOV001.MOD MOV002.MOD ... MOV009.MOD MOV00A.MOD MOV00B.MOD .. MOV00F.MOD MOV010.MOD MOV011.MOD ... MOV01A.MOD MOV01B.MOD e.g. They way it was before the recent client release. This had already been fixed a couple of years or more ago.

Actual behaviour

Files/folders are not sorted in sequential order. e.g. files MOV00F. appear before MOV001. This makes it very difficult to play videos in sequential order. ... MOV00E.MOD MOV00F.MOD MOV001.MOD MOV01A.MOD MOV01B.MOD ... MOV01F.MOD MOV002.MOD ... MOV009.MOD

Image

Logs

If applicable, you can post the iOS app or server logs (removing any sensitive information).

N/A

Reasoning or why should it be changed/implemented?

This is a reversion of a bug that was fixed a long time ago.

Environment data

iOS version: e.g. iOS 17.6.1 17.7.1 Nextcloud iOS app version: see More > Settings 6.1.3.0 Server operating system: "Raspbian GNU/Linux 10 (buster)" Web server: Apache, nginx Apache Database: Mariadb PHP version: 7.3 Nextcloud version: see Nextcloud admin page 23.0.12

marinofaggiana commented 2 days ago

Hi @biggreenogre the reason why MOVE00E precedes MOVE001 when using localizedStandardCompare is related to how strings are compared based on human-readable sorting rules (similar to how the Finder works on macOS). These rules take into account numbers and alphanumeric characters in an order that feels more natural to humans.

LocalizedStandardCompare is designed to mimic a “human-friendly” order, which prioritizes alphabetical characters over numbers. This behavior is useful for intuitive sorting but might not match your desired order in every case.