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);