question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

custom sorting method for a single directory

See original GitHub issue

First of all, thanks for the great package. It is really helpful and has given to me and my family many happy moments.

Feature description I’m trying to figure out a way to apply custom sorting method on root directory. For me, the most obvious way to browse a picture gallery is having the latest folders on top in the root directory and the files/folder inside each folder sorted by ascending date.

Proposed solution A specific directory should have a way to override the general settings for sorting methods. I think the best (simplest) way would be by having a hidden file (ex. .order_descending_name).

More info on my solution I have all my pictures in folders with prepending date, (ex. 2010.09.02 John's wedding). Sorting the root directory by descending name is the absolutely best approach for the gallery root; recent events are on top. But, if I set that method to settings, photos inside each folder are in reverse order, having the latest on top, which is not helpful.

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
bpatrikcommented, Sep 6, 2020

Alright. I had some time and added this functionality. 😃 Here you can see how it works: https://github.com/bpatrik/pigallery2/blob/73a8c4202a9d4fd7746e080a339c0fa644d4b32f/src/common/PG2ConfMap.ts#L10-L14

Basically, you add an empty file like .order_descending_name.pg2conf to a folder and that overrides the default sorting for that folder.

1reaction
bpatrikcommented, Apr 17, 2021

No, it only works in a given folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I set a custom order for folders on Windows 7 and 10?
I generally do this by simply prefixing the folders with either letters or numbers, as though they were sections of a document:
Read more >
Python Custom sort files read from directory - Stack Overflow
This works for the "restr" files. But the sorting for numbers is not correct. I get the list as ['feed_restr_013_9.zip', 'feed_013_9.zip', ' ...
Read more >
Sort data using a custom list - Microsoft Support
From the Order drop-down, select Custom List. Sort dialog box. In the Custom Lists box, select the list that you want, and then...
Read more >
[Algorithm Tips & Tricks] Sorting with Custom Comparators ...
A custom comparator is a function that takes two instances of whatever data type you're trying to sort, and the function has logic...
Read more >
Ranger: custom file sorting (dotfiles at the end of listing)
Ranger: custom file sorting (dotfiles at the end of listing) · Folders alphabetically · Files alphabetically · Folders starting with .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found