fix(app): Tags… changes only the tags, from their current values

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-06 20:49:50 +00:00
1 parent 007c5b281d
commit 9609b8776e
1 file changed
+4 -2
@@ -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);