by pbpb » Thu Jul 09, 2020 7:21 pm
No, I am not proposing that.
Rather, suppose that I want to sort by Artist, but I also want the files sorted by Title within that (and each) artist. Then currently as I understand it, if I first sort by Title, and then ctrl-sort by Artist, I will achieve the desired result. That's what you are telling me to do. I know that.
Also currently, if I first sort by Title, then sort by Artist, the titles will end up in random order. (Ok, it's not random, it just looks random.)
What I am proposing is that the second method, which currently does not produce the desired result (sort by title, then sort by artist), would produce the same result as the first (correct) method, if the sort algorithm were a stable sort, i.e. the relative order produced in sort by title would be preserved after the subsequent sort by artist.
That does, however, require that the second sort be performed on the result of the first sort, which might incur additional overhead. It may well be that the particular algorithm being used is stable, but is applied each time to the same starting state. The link I provided has a list of sort algorithms indicating which are stable and which aren't. If I recall correctly, the old old mp3collectorz windows app did use a stable sort and had the behavior I am suggesting.
I mentioned Title and Artist only because that was the thing I wanted to do today. My suggestion would apply to any fields, and in any number, as long as done in the right order.
No, I am not proposing that.
Rather, suppose that I want to sort by Artist, but I also want the files sorted by Title within that (and each) artist. Then currently as I understand it, if I first sort by Title, and then ctrl-sort by Artist, I will achieve the desired result. That's what you are telling me to do. I know that.
Also currently, if I first sort by Title, then sort by Artist, the titles will end up in random order. (Ok, it's not random, it just looks random.)
What I am proposing is that the second method, which currently does not produce the desired result (sort by title, then sort by artist), would produce the same result as the first (correct) method, if the sort algorithm were a stable sort, i.e. the relative order produced in sort by title would be preserved after the subsequent sort by artist.
That does, however, require that the second sort be performed on the result of the first sort, which might incur additional overhead. It may well be that the particular algorithm being used is stable, but is applied each time to the same starting state. The link I provided has a list of sort algorithms indicating which are stable and which aren't. If I recall correctly, the old old mp3collectorz windows app did use a stable sort and had the behavior I am suggesting.
I mentioned Title and Artist only because that was the thing I wanted to do today. My suggestion would apply to any fields, and in any number, as long as done in the right order.