[BBD] Sorting bug (when stacks are involved)?

Started by Darius1968, July 19, 2022, 11:26:27 AM

Previous topic - Next topic

Darius1968

If I sort ascending on just the file name, I get expected results.  However, if I sort on both keys - 1.  Stack, 2.  File Name (both ascending), results are strange: 

Specifically, all files part of a stack are at the top, which is what I expect.  But of those six files that part of a stack, the order is as follows:  #10, #11, #12, #13, #22, #1. 

So, something is going on when I involve stacks in my sort profile that needs ironed out.  Are you able to duplicate this result? 

Mario

Please provide more details.
Your sort profile (screen shot), the file names used for the sort if you consider them relevant.
Always open a bug report when you consider something to be a bug. I can only track bug reports, not messages in general discussion.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

Maybe related to this (solved) bug:

Sort order with attributes and file name mismatch?
https://www.photools.com/community/index.php?topic=12595.msg89095#msg89095

ger

Darius1968

#3
Okay.

These 1st-two images show my file-window-result and the sort profile (respectively), which prove sort (ascending) by the file name is okay: 



And, these last two images are for the case in which I sort (ascending) on both keys - Stack and File Name, and show my file-window-result and the sort profile (respectively), showing that all files part of a stack are at the top (where they should be), but also that the ordering among those files part of a stack is off.



Mario

#4
When you sort by stack, IMatch uses

a) unique stack id when the file is the top of the stack
b) the unique stack id and the name of the file (name.ext, no path) when the file is part of a stack.

This ensures a definitive and stable sort order for files when you sort by the containing stack (the stack id is the same for all files).
Mixing stack with other sort attributes makes not much sense.
This behavior is by design.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

#5
I just have Stack as the 1st-sort-key so that I can quickly tell which of my videos have stills associated with them. 
Is there any way to manually regenerate the unique stack ids so that I can enforce the ordering? 

Mario

Since the Stack attribute already considers the file name, just remove the other file name sort attribute.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Darius1968

That has the same result as using both attributes - Stack, File Name - at the same time.  Yes, File Name can be dropped because the Stack attribute already has it.  But, how to actually regenerate the Stack's ID, such that the ordering by File Name is possible? 

Mario

The stack id is an internal number and not accessible to users. It can change any time, being re-created when needed.
You cannot use this for your purposes.

Since this behavior is by design and not a bug, I'll close this ticket.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook