-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
(fix) Library: allow adding new dirs while we have missing watched dir(s) #12937
Conversation
// 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)) { |
There was a problem hiding this comment.
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.
src/library/dao/directorydao.cpp
Outdated
<< "does not exist or is inaccessible"; | ||
return AddResult::InvalidOrMissingDirectory; | ||
} | ||
// Ignore invalid or missing directories in order to aloow adding new dirs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Ignore invalid or missing directories in order to aloow adding new dirs | |
// Ignore invalid or missing directories in order to allow adding new dirs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, fixed.
12c17e9
to
44177ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
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.