mokuro icon indicating copy to clipboard operation
mokuro copied to clipboard

Improved image sorting.

Open ChristopherFritz opened this issue 1 year ago • 1 comments

Sorts images by folder then file name.

Addresses issue #25.

This was tested with files named as shown below.

Sort before code change:

  • Chapter 1/0003.jpg
  • Chapter 20/0051.jpg
  • Chapter 69/13.jpg
  • Chapter 69/3.jpg
  • Chapter 9/0079.jpg

Sort after code change:

  • Chapter 1/0003.jpg
  • Chapter 9/0079.jpg
  • Chapter 20/0051.jpg
  • Chapter 69/3.jpg
  • Chapter 69/13.jpg

Disclaimer: I don't really know Python, so I figured things as out I went to try and address this issue.

ChristopherFritz avatar Oct 10 '22 05:10 ChristopherFritz

Afterthought: I should have separate sort_width variables for folders and images, but the way it's written doesn't hurt any.

ChristopherFritz avatar Oct 10 '22 06:10 ChristopherFritz

I decided to use the natsort library after all, but thank you for your contribution, and sorry for the delayed repsonse.

kha-white avatar Nov 05 '22 12:11 kha-white