Fix #10209: Show message when rescanning with no library folders - #15972
Conversation
|
Welcome and thanks fo rthis PR! Though, I think you overlooked the fact that the scanner is not only responsible for the selected directories and the tracks inside those, but also for checking the existence of "free" tracks. By that I mean tracks outside the dirs that have been added to the library implicitly by loading them to a player, eg. DnD from file browser. I think that also applies to played tracks from external features like Traktor and Rekordbox, but I'm not sure about that. So the current "no dirs" early return is wrong. I think we should remove that throw that message (or different messages) only when |
|
Please, don't move the conversation to commit messages (are you using AI for coding and/or responding??). |
|
Sorry About That. I should have discussed here first. About AI - I wrote this PR msg in Code with AI for formatting and spellings. Right Now - the only bug I see is that the user gets no response when he scans Library with no free tracks and library setup I was thinking about letting the scan run and later check if no tracks are found also with no directories to scan - then we can probably be certain about showing a Response in the UI. |
|
I’ve updated |
ronso0
left a comment
There was a problem hiding this comment.
Thank you, looks good already, left some commenst.
| result.autoscan = m_manualScan; | ||
| result.noDirectoriesConfigured = true; | ||
|
|
||
| emit scanSummary(result); |
There was a problem hiding this comment.
I think we need to set the scanner state first, then emit the signal
There was a problem hiding this comment.
Good catch, fixed the order — changeScannerState(IDLE) now comes before emit scanSummary(result).
| int numNewMissingTracks; | ||
| int numRediscoveredTracks; | ||
| int tracksTotal; | ||
| bool noDirectoriesConfigured = false; |
There was a problem hiding this comment.
see above (do we need this?)
and if we want to have it false by default we should rather add a default constructor for this struct, no?
There was a problem hiding this comment.
Done, added a default constructor to LibraryScanResultSummary that zero-initializes all fields. Removed the in-class initializer.
|
All review comments addressed:
Thanks for the thorough review, @ronso0! |
|
Btw merging the base branch is usually only required if conflicts emerged, or when we need to pull urgent bugfixes that affect the feature that is being worked on. |
Understood, thanks for explaining. I merged base assuming it was required to keep the branch up to date — I'll avoid unnecessary base merges going forward and only rebase when there are actual conflicts. |
ronso0
left a comment
There was a problem hiding this comment.
Okay, great! LGTM and works as expected.
Please squash the commits and rebase onto the parent of the initial commit.
If you've never done that, this should work:
git rebase -i 5f07c48^1
- remove all merge commits in the editor, only your commits shoudl remain
- for your first commit replace
pickwithr(reword message) - for the others replace
pickwithf(fixup) for all of your commits - confirm, then edit the commit message. Something like this would suffice IMO (taken from your first commit):
Show message when rescanning with no library folders or tracks When users try to rescan the library with no folders configured, show a helpful message guiding them to add folders instead of silently doing nothing. - confirm and proceed with squashing
- force-push
Then hopefully the compare view wil be empty (thumbs pressed ; )
02d0e04 to
1fb4bb4
Compare
|
Done, squashed and force-pushed to a single commit on top of upstream/main. |
| // reassign summary to avoid showing "Scan took <Empty String>" | ||
| // which is not relevant in this case - no scan was actually | ||
| // performed | ||
| } |
There was a problem hiding this comment.
(the more often we look at code, the better it gets over time : )
Just an idea to make this if/else flow a bit cleaner, and avoid the double re-assignment of summary:
- move the QMessageBox instantiation up, below the
if (result.autoscan && ...block - then comes the current
if (result.noDirectoriesConfigured) {, pluspMsg->setText(summary); pMsg->show(); return; - then continue with the other if/else
What do you think?
There was a problem hiding this comment.
Good call, agreed this is cleaner. Moved the QMessageBox instantiation up and made noDirectoriesConfigured an early return — the summary string is now only built when a scan actually ran, so the workaround comment is gone too. Updated.
ronso0
left a comment
There was a problem hiding this comment.
Thank you, LGTM and works nicely!
Thanks for your patience.
|
Please squash the 2nd commit into the1st one (leave the commit message as is), then we can finally merge. |
When users try to rescan the library with no folders configured, show a helpful message guiding them to add folders instead of silently doing nothing.
d5a781e to
92010de
Compare
Done, squashed and force-pushed. |
|
Thank you! waiting for CI.. |


Fixes #10209
Problem
Previously, when users clicked "Rescan Library" with no music folders configured, nothing happened. The scan would silently complete instantly without any feedback, leaving users confused about whether the feature was working.
Solution
This PR adds a helpful dialog that appears when users try to rescan with no folders configured. The dialog clearly explains:
Screenshot
After this fix:
The dialog now provides clear feedback and guidance to users.
Implementation
noDirectoriesConfiguredboolean flag toLibraryScanResultSummarystructLibraryScanner::slotStartScan()when no directories are foundMixxxMainWindow::slotLibraryScanSummaryDlg()to display a custom message when the flag is setTesting
Tested on macOS by:
Feedback welcome - this is my first contribution to Mixxx and I'm eager to learn!