Bugfixes and Improvements Tag Management

This commit is contained in:
Stefan Hardegger
2025-08-18 08:54:18 +02:00
parent 1a99d9830d
commit 95ce5fb532
4 changed files with 491 additions and 42 deletions

View File

@@ -355,9 +355,13 @@ public class TagService {
// Calculate preview data
int targetStoryCount = targetTag.getStories().size();
int totalStories = targetStoryCount + sourceTags.stream()
.mapToInt(tag -> tag.getStories().size())
.sum();
// Collect all unique stories from all tags (including target) to handle overlaps correctly
Set<Story> allUniqueStories = new HashSet<>(targetTag.getStories());
for (Tag sourceTag : sourceTags) {
allUniqueStories.addAll(sourceTag.getStories());
}
int totalStories = allUniqueStories.size();
List<String> aliasesToCreate = sourceTags.stream()
.map(Tag::getName)