mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-11 16:31:32 -06:00
LRC-LIB-KEYWORDS: a set keyword toggles off whatever its case
`keyword.toggleFromSet` checked whether every target photo had the keyword by ASCII case, while the set's buttons and the rest of the keyword code match any letter's case: with "ÄRZTE" and "ärzte" on the photos the button showed on, but ⌥N added the keyword (a no-op) instead of taking it off, so it could never be toggled off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
69c91013e0
commit
f2f164f012
@@ -184,7 +184,11 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
};
|
||||
let ids = s.targets(p);
|
||||
let all = !ids.is_empty()
|
||||
&& ids.iter().all(|id| s.catalog.photo(*id).is_some_and(|ph| ph.meta.keywords.iter().any(|x| x.eq_ignore_ascii_case(&k))));
|
||||
&& ids.iter().all(|id| {
|
||||
s.catalog
|
||||
.photo(*id)
|
||||
.is_some_and(|ph| ph.meta.keywords.iter().any(|x| lightcraft_catalog::keywords::same(&clean(x), &clean(&k))))
|
||||
});
|
||||
let ids: Vec<u64> = ids.iter().map(|i| i.0).collect();
|
||||
let key = if all { "removeKeywords" } else { "addKeywords" };
|
||||
// applying from Recent Keywords mustn't reshuffle the numbers under the keys
|
||||
|
||||
Reference in New Issue
Block a user