From 9609b8776e475bbd8a94f7b79b7893c518a65ea8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 20:49:50 +0000 Subject: [PATCH] =?UTF-8?q?fix(app):=20Tags=E2=80=A6=20changes=20only=20th?= =?UTF-8?q?e=20tags,=20from=20their=20current=20values?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Library's Tag action and the Archive manager's Retag applied the additions and removals to the set's copy of the tags and wrote back its title, rating and notes, undoing any edit or sync made since the set was read. Each sequence now edits its current tags through EditSequenceInfoAsync and leaves the other fields alone. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- src/Titano.App/Archive/ArchiveDialogViewModels.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Titano.App/Archive/ArchiveDialogViewModels.cs b/src/Titano.App/Archive/ArchiveDialogViewModels.cs index 9b938445..69c10565 100644 --- a/src/Titano.App/Archive/ArchiveDialogViewModels.cs +++ b/src/Titano.App/Archive/ArchiveDialogViewModels.cs @@ -391,6 +391,7 @@ public sealed class RetagDialogViewModel : ArchiveDialogViewModel private async Task ApplyAsync() { var changes = Changes(); + var (add, remove) = (Retag.Parse(Add.Text), Retag.Parse(Remove.Text)); var run = _run = new CancellationTokenSource(); var done = 0; ClearError(); @@ -399,9 +400,10 @@ public sealed class RetagDialogViewModel : ArchiveDialogViewModel { for (; done < changes.Count && !run.IsCancellationRequested; done++) { - var (s, tags) = changes[done]; + var id = changes[done].Sequence.Id; BusyText = Loc.L("Archive.Rename.Applying", Formatting.Count(done + 1), Formatting.Count(changes.Count)); - await Task.Run(() => _archives.SetSequenceInfoAsync(s.Id, s.Title, tags, s.Rating, s.Notes)); + // The tags as they are now (the set may predate an edit or a sync); title, rating and notes stay untouched. + await Task.Run(() => _archives.EditSequenceInfoAsync(id, info => info with { Tags = Retag.Apply(info.Tags, add, remove) })); } Log.Info("archive", $"Retag: {done} of {changes.Count} sequence(s) changed"); await _applied(done);