Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library Scanner: sort files before adding #10919

Merged
merged 1 commit into from
Sep 30, 2022
Merged

Conversation

poelzi
Copy link
Contributor

@poelzi poelzi commented Sep 26, 2022

Sort files in each scanned directory alphabetically before adding. This causes folders which contain track numbered files to be added in it's natural order, so sorting after date added also sorts for track numbers. Since the tracks will have slightly different timestamps, using a second sorting does not work.

@poelzi
Copy link
Contributor Author

poelzi commented Sep 26, 2022

An alternative aproach would be, to add a date(datetime_added) column to the temporary view and use this for sorting, but this would likely require larger changes.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Just added some C++11 ideas.

src/library/scanner/recursivescandirectorytask.cpp Outdated Show resolved Hide resolved
src/library/scanner/recursivescandirectorytask.cpp Outdated Show resolved Hide resolved
Sort files in each scanned directory alphabetically before adding.
This causes folders which contain track numbered files to be added
in it's natural order, so sorting after date added also sorts for track
numbers. Since the tracks will have slightly different timestamps, using a
second sorting does not work.
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thank you.

@daschuer daschuer merged commit b11f8f8 into mixxxdj:main Sep 30, 2022
@daschuer daschuer added the changelog This PR should be included in the changelog label Sep 30, 2022
@daschuer daschuer added this to the 2.4.0 milestone Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This PR should be included in the changelog library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants