|
@@ -6,7 +6,7 @@
|
|
|
import Router from '@koa/router';
|
|
import Router from '@koa/router';
|
|
|
import { Context } from 'koa';
|
|
import { Context } from 'koa';
|
|
|
import { langGraphGenerator, getScaleConfig, resolveGenLevel, mapBookTypeToGenLevel } from './index';
|
|
import { langGraphGenerator, getScaleConfig, resolveGenLevel, mapBookTypeToGenLevel } from './index';
|
|
|
-import { bookStore } from './book-generator.store';
|
|
|
|
|
|
|
+import { bookStore, cancelAudioGeneration } from './book-generator.store';
|
|
|
import { prisma } from '../../models';
|
|
import { prisma } from '../../models';
|
|
|
import { estimateBookWords, estimateAudioMinutesFromWords, checkBookGenerationQuota, checkAudioQuota } from '../subscription/subscription.service';
|
|
import { estimateBookWords, estimateAudioMinutesFromWords, checkBookGenerationQuota, checkAudioQuota } from '../subscription/subscription.service';
|
|
|
import { optionalAuth } from '../../middleware/auth';
|
|
import { optionalAuth } from '../../middleware/auth';
|
|
@@ -1060,7 +1060,7 @@ router.post('/books/:id/audio/cancel', async (ctx: Context) => {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const result = await bookStore.cancelAudioGeneration(bookId);
|
|
|
|
|
|
|
+ const result = await cancelAudioGeneration(bookId);
|
|
|
|
|
|
|
|
if (result.cancelledCount === 0) {
|
|
if (result.cancelledCount === 0) {
|
|
|
ctx.body = {
|
|
ctx.body = {
|