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

(fix) Library: allow adding new dirs while we have missing watched dir(s) #12937

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Mar 8, 2024

Fixes the original issue of #10481

I don't understand how the "inconsistencies" mentioned in the comment can be so serious that we have to prevent adding a new directory.
After a rescan, everything should be fine.

@ronso0 ronso0 added this to the 2.4.1 milestone Mar 8, 2024
// Worst that can happen is that we have orphan tracks in the database that
// would be moved to missing after the rescan (which is required anyway after
// having added a new dir).
for (auto&& oldDir : loadAllDirectories(true)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively, use the current implemantation but don't return if the old dir is missing. Instead, do the QString equivalent of mixxx::FileInfo::isRootSubCanonicalLocation(new, old) in that case.
This requires refactirng here, i.e. use DirectoryDAO::getRootDirStrings() added in #12878 and construct the mixxx::FileInfo here.

<< "does not exist or is inaccessible";
return AddResult::InvalidOrMissingDirectory;
}
// Ignore invalid or missing directories in order to aloow adding new dirs
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Ignore invalid or missing directories in order to aloow adding new dirs
// Ignore invalid or missing directories in order to allow adding new dirs

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, fixed.

@ronso0 ronso0 force-pushed the lib-add-dir-while-missing-is-listed branch from 12c17e9 to 44177ed Compare April 14, 2024 22:25
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 45a807d into mixxxdj:2.4 Apr 15, 2024
14 checks passed
@ronso0 ronso0 deleted the lib-add-dir-while-missing-is-listed branch April 15, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants