collection fix

This commit is contained in:
Stefan Hardegger
2026-07-20 09:28:02 +02:00
parent fedd9b7ae7
commit cd9e62d9ad
4 changed files with 18 additions and 43 deletions

View File

@@ -126,8 +126,8 @@ public class CollectionService {
savedCollection = findById(savedCollection.getId());
}
// Collections are not indexed in search engine yet
searchServiceAdapter.indexCollection(savedCollection);
logger.info("Created collection: {} with {} stories", name, initialStoryIds != null ? initialStoryIds.size() : 0);
return savedCollection;
}
@@ -155,9 +155,8 @@ public class CollectionService {
}
Collection savedCollection = collectionRepository.save(collection);
// Collections are not indexed in search engine yet
searchServiceAdapter.updateCollection(findById(savedCollection.getId()));
logger.info("Updated collection: {}", id);
return savedCollection;
}
@@ -167,9 +166,7 @@ public class CollectionService {
*/
public void deleteCollection(UUID id) {
Collection collection = findByIdBasic(id);
// Collections are not indexed in search engine yet
searchServiceAdapter.deleteCollection(id);
collectionRepository.delete(collection);
logger.info("Deleted collection: {}", id);
}
@@ -182,9 +179,8 @@ public class CollectionService {
collection.setIsArchived(archived);
Collection savedCollection = collectionRepository.save(collection);
// Collections are not indexed in search engine yet
searchServiceAdapter.updateCollection(findById(savedCollection.getId()));
logger.info("{} collection: {}", archived ? "Archived" : "Unarchived", id);
return savedCollection;
}
@@ -227,9 +223,8 @@ public class CollectionService {
position += 1000; // Gap-based positioning
}
// Update collection in Typesense
// Collections are not indexed in search engine yet
searchServiceAdapter.updateCollection(findById(collectionId));
long totalStories = collectionStoryRepository.countByCollectionId(collectionId);
logger.info("Added {} stories to collection {}, skipped {} duplicates", added, collectionId, skipped);
@@ -251,10 +246,8 @@ public class CollectionService {
CollectionStory collectionStory = collectionStoryRepository.findByCollectionIdAndStoryId(collectionId, storyId);
collectionStoryRepository.delete(collectionStory);
// Update collection in Typesense
// Collections are not indexed in search engine yet
searchServiceAdapter.updateCollection(findById(collectionId));
logger.info("Removed story {} from collection {}", storyId, collectionId);
}
@@ -285,9 +278,8 @@ public class CollectionService {
collectionStoryRepository.updatePosition(collectionId, storyId, position * 1000); // Gap-based positioning
}
// Update collection in Typesense
// Collections are not indexed in search engine yet
searchServiceAdapter.updateCollection(findById(collectionId));
logger.info("Reordered {} stories in collection {}", storyOrders.size(), collectionId);
}