telegram-upload icon indicating copy to clipboard operation
telegram-upload copied to clipboard

Numbered files are uploaded in weird order

Open tissole opened this issue 3 years ago • 4 comments

Hello and thank you for developing this app. My config:

  • telegram-upload version: 0.4.0
  • Python version: 3.9.2
  • Operating System: Windows 10
  • Dependencies list (run pip freeze): cffi==1.14.5 click==7.1.2 cryptg==0.2.post4 hachoir==3.1.2 pyaes==1.6.1 pyasn1==0.4.8 pycparser==2.20 rsa==4.7.2 telegram-upload==0.4.0 Telethon==1.21.1

Description

When files are numbered 1, 2, 3...10, 11, 12, etc, the app uploads them in a weird manner 1, 10, 11, 12...2, 3, 4, etc

What I Did

telegram-upload --directories recursive -a 'D:\Docs'

I wish that the files are uploaded like this: 1, 2, 3, 4... 10, 11, 12, etc

tissole avatar May 02 '21 13:05 tissole

It will be added in a future version (the files will be sorted alphabetically). Thanks!

Nekmo avatar Jun 01 '21 22:06 Nekmo

Great! Thank you!

tissole avatar Jun 03 '21 10:06 tissole

It will be added in a future version (the files will be sorted alphabetically). Thanks!

Just if it helps:

In order to upload the files in the order that the user requests, you would mean the files will be sorted by Natural Sort Order (Windows Explorer sorting). Which is exact the opposite of the current alphabetical sort of telegram-upload:

Alphabetical sorting: z11 z2

Natural sorting: z2 z11

https://en.wikipedia.org/wiki/Natural_sort_order

ElektroStudios avatar Jun 29 '21 17:06 ElektroStudios

@ElektroStudios Yes, this is what I want, but I didn't know the correct name for this feature, Thank you for the info!

tissole avatar Aug 08 '21 17:08 tissole

Fixed in v0.6.0. Use the --sort parameter. The natsort Python package must be installed for natural ordering.

pip install natsort

Nekmo avatar Jun 14 '23 18:06 Nekmo