fix cover url export to audiocove

This commit is contained in:
Stefan Hardegger
2026-07-22 07:14:46 +02:00
parent b0febfae64
commit 2f4ed2efd0
2 changed files with 16 additions and 15 deletions

View File

@@ -211,25 +211,21 @@ public class StoryService {
@Transactional
public Story setCoverImage(UUID id, String imagePath) {
Story story = findById(id);
// Delete old cover if exists
if (story.getCoverPath() != null && !story.getCoverPath().isEmpty()) {
// Note: ImageService would be injected here in a real implementation
// For now, we just update the path
}
story.setCoverPath(imagePath);
return storyRepository.save(story);
Story savedStory = storyRepository.save(story);
searchServiceAdapter.updateStory(savedStory);
return savedStory;
}
@Transactional
@Transactional
public void removeCoverImage(UUID id) {
Story story = findById(id);
if (story.getCoverPath() != null && !story.getCoverPath().isEmpty()) {
// Note: ImageService would be injected here to delete file
story.setCoverPath(null);
storyRepository.save(story);
Story savedStory = storyRepository.save(story);
searchServiceAdapter.updateStory(savedStory);
}
}
@@ -490,13 +486,17 @@ public class StoryService {
public Story setCover(UUID id, String coverPath) {
Story story = findById(id);
story.setCoverPath(coverPath);
return storyRepository.save(story);
Story savedStory = storyRepository.save(story);
searchServiceAdapter.updateStory(savedStory);
return savedStory;
}
public Story removeCover(UUID id) {
Story story = findById(id);
story.setCoverPath(null);
return storyRepository.save(story);
Story savedStory = storyRepository.save(story);
searchServiceAdapter.updateStory(savedStory);
return savedStory;
}
public Story addToSeries(UUID storyId, UUID seriesId, Double volume) {

View File

@@ -43,6 +43,7 @@ services:
- STORYCOVE_CORS_ALLOWED_ORIGINS=${STORYCOVE_CORS_ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:6925}
- AUDIOCOVE_URL=${AUDIOCOVE_URL:-}
- AUDIOCOVE_API_KEY=${AUDIOCOVE_API_KEY:-}
- STORYCOVE_PUBLIC_URL=${STORYCOVE_PUBLIC_URL:-http://localhost:6925}
volumes:
- ${DATA_DIR:-/volume1/docker/storycove}/images:/app/images
- ${DATA_DIR:-/volume1/docker/storycove}/config:/app/config