Fix unneeded image processing

This commit is contained in:
Stefan Hardegger
2026-03-25 13:34:09 +01:00
parent 6ec7b93589
commit f2443ae664
2 changed files with 5 additions and 2 deletions

View File

@@ -178,8 +178,9 @@ public class StoryController {
Story updatedStory = storyService.updateWithTagNames(id, request); Story updatedStory = storyService.updateWithTagNames(id, request);
// Process external images in content after saving // Image processing for updates is handled by the frontend via the dedicated
updatedStory = processExternalImagesIfNeeded(updatedStory); // /process-content-images endpoint, so no async processing is triggered here.
// (Async processing on every PUT caused concurrent duplicate downloads.)
logger.info("Successfully updated story: {}", updatedStory.getTitle()); logger.info("Successfully updated story: {}", updatedStory.getTitle());
return ResponseEntity.ok(convertToDto(updatedStory)); return ResponseEntity.ok(convertToDto(updatedStory));

View File

@@ -225,6 +225,8 @@ export default function EditStoryPage() {
...(formData.authorId ? { authorId: formData.authorId } : { authorName: formData.authorName }), ...(formData.authorId ? { authorId: formData.authorId } : { authorName: formData.authorName }),
tagNames: formData.tags, tagNames: formData.tags,
}); });
// Keep editor state in sync with local URLs so subsequent saves don't re-download
setFormData(prev => ({ ...prev, contentHtml: imageResult.processedContent }));
} }
} catch (imageError) { } catch (imageError) {
console.warn('Failed to process images, continuing with original content:', imageError); console.warn('Failed to process images, continuing with original content:', imageError);