Repository navigation
Refuse Open/New Library while an import is running (#1509) - #1578
Merged
Merged
Conversation
Member
|
Thank you @MarekSpodBiedry! This landed on main in integration batch 35 (#1682). If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1509.
app.openLibraryandapp.newLibraryonly refused to switch while a Lightroom catalog import ran. An ordinary import (app.import) kept going after the switch, and its remaining batches were committed into the newly opened library with the old run's options and album ids. The folder scan that comes before an import (app.scan) had the same problem: it finishes into an import, or the review, against whatever library is open by then.Changes in
crates/ui-egui:panels/settings.rs: a newcan_switch_libraryguard that both commands call. It keeps the Lightroom check and also refuses whileapp.importorapp.scanis running. That matches the Lightroom import's ownbusy()check (app.import.is_some() || app.scan.is_some()→ "an import is running"). The error asks the user to wait for the import to finish.menus.rs/menubar.rs: File ▸ Open Library…, New Library… and the Open Recent Library items use the same guard. They are greyed out during an import, as they already are during a Lightroom import. File ▸ Add Folder keeps its previous rule.The switch is refused rather than cancelling or draining the import. Nothing in flight is thrown away, and this is the behaviour the Lightroom guard already has.
Tests (in
panels/settings.rs):