v 3.4.2
1. 新增 图/文转视频 菜单界面,专注实现图/文转视频(目前只集成了 MJ VIDEO) 1. 全新的界面排列,小说列表和批次任务更加分明 2. 添加转视频进度,在主界面即可看到转视频的比例 3. 单独的界面去处理图转视频,避免表格数据过多繁琐 4. 新增分页显示,界面加载更快,也可切换不分页,需要更多的事件等待加载 5. 单独操作面板,参数修改处理更加清晰,支持多种模式显示,右侧固定或抽屉模式 6. 批量设置转视频配置,可以批量修改分类 7. 友好的选择视频界面 2. 重写 软件导出剪映,修复若干草稿导出问题 1. 修复导出剪映文案和图片对齐会有些许对不上,时长越长越明显 2. 修复导出草稿关键帧部分问题 3. 导出的文案通过分镜自动导入,不再需要手动选择SRT 3. 美化 生成草稿界面 弹窗,优化部分逻辑 1. 删除选择SRT文件,SRT根据聚合推文中导入的SRT自动生成草稿 2. 只需选择配音文件即可,配音文件和导入的SRT请自行对应 3. 背景音乐不在内部设置,自行选择文件夹或者是MP3、WAV文件 4. 背景音乐选择文件夹则读取文件夹,随机获取一个 5. 背景音乐选择指定的音乐文件则使用选择的
This commit is contained in:
@@ -260,6 +260,32 @@ export class BookBackTaskListService extends BaseRealmService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新后台任务的数据
|
||||
* @param taskId 任务ID
|
||||
* @param backTaskParam 需要更新的任务数据部分字段
|
||||
*/
|
||||
UpdateBackTaskData(taskId: string, backTaskParam: Partial<TaskModal.Task>): void {
|
||||
this.transaction(() => {
|
||||
// 根据ID获取后台任务
|
||||
let backTask = this.realm.objectForPrimaryKey('BookBackTaskList', taskId)
|
||||
// 检查任务是否存在
|
||||
if (backTask == null) {
|
||||
throw new Error('更新后台任务数据失败,未找到对应的任务')
|
||||
}
|
||||
// 遍历需要更新的字段
|
||||
for (const key in backTaskParam) {
|
||||
// 跳过ID字段,防止主键被修改
|
||||
if (key == "id") {
|
||||
continue;
|
||||
}
|
||||
// 更新对应字段的值
|
||||
backTask[key] = backTaskParam[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除满足条件的数据,包含 id、bookId、bookTaskId
|
||||
* 上面的条件,至少要有一个
|
||||
|
||||
@@ -281,6 +281,15 @@ const migration = (oldRealm: Realm, newRealm: Realm) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (oldRealm.schemaVersion < 44) {
|
||||
const oldBookTask = oldRealm.objects('BookBackTaskList')
|
||||
const newBookTask = newRealm.objects('BookBackTaskList')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].taskId = undefined;
|
||||
newBookTask[i].taskMessage = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class BaseRealmService extends BaseService {
|
||||
@@ -323,7 +332,7 @@ export class BaseRealmService extends BaseService {
|
||||
VideoMessage
|
||||
],
|
||||
path: this.dbpath,
|
||||
schemaVersion: 43,
|
||||
schemaVersion: 44,
|
||||
migration: migration
|
||||
}
|
||||
this.realm = await Realm.open(config)
|
||||
|
||||
@@ -12,6 +12,7 @@ import { FfmpegOptions } from '../../../../main/Service/ffmpegOptions.js'
|
||||
import { version } from '../../../../../package.json'
|
||||
import { Book } from '../../../../model/book/book.js'
|
||||
import { GeneralResponse } from '../../../../model/generalResponse.js'
|
||||
import { ImageToVideoModels } from '@/define/enum/video.js'
|
||||
|
||||
export class BookService extends BaseRealmService {
|
||||
static instance: BookService | null = null
|
||||
@@ -210,6 +211,8 @@ export class BookService extends BaseRealmService {
|
||||
throw new Error('未知的小说类型')
|
||||
}
|
||||
|
||||
let videoCategory = ImageToVideoModels.MJ_VIDEO;
|
||||
|
||||
this.realm.write(() => {
|
||||
book.version = version
|
||||
this.realm.create('Book', book)
|
||||
@@ -233,6 +236,7 @@ export class BookService extends BaseRealmService {
|
||||
createTime: new Date(),
|
||||
version: version,
|
||||
imageCategory: imageCategory,
|
||||
videoCategory: videoCategory,
|
||||
openVideoGenerate: false
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ const { v4: uuidv4 } = require('uuid')
|
||||
import { Book } from "../../../../model/book/book"
|
||||
import { GeneralResponse } from '../../../../model/generalResponse.js'
|
||||
import { BookTaskDetail } from '@/model/book/bookTaskDetail'
|
||||
import { ValidateJson } from '@/define/Tools/validate'
|
||||
|
||||
let dbPath = path.resolve(define.db_path, 'book.realm')
|
||||
|
||||
@@ -73,8 +74,21 @@ export class BookTaskDetailService extends BaseRealmService {
|
||||
subImagePath: (item.subImagePath as string[])?.map((subImage) => {
|
||||
return JoinPath(define.project_path, subImage)
|
||||
}),
|
||||
subVideoPath: (item.subVideoPath as string[])?.map((subVideo) => {
|
||||
return JoinPath(define.project_path, subVideo)
|
||||
subVideoPath: (item.subVideoPath as string[]).map((subVideo) => subVideo.toString()),
|
||||
subVideoPathObject: (item.subVideoPath as string[])?.map((subVideo) => {
|
||||
if (isEmpty(subVideo)) {
|
||||
return {};
|
||||
} else {
|
||||
if (!ValidateJson(subVideo)) {
|
||||
return {};
|
||||
} else {
|
||||
let obj = JSON.parse(subVideo);
|
||||
if (!isEmpty(obj.localPath)) {
|
||||
obj.localPath = JoinPath(define.project_path, obj.localPath) + '?t=' + new Date().getTime();
|
||||
}
|
||||
return obj
|
||||
}
|
||||
}
|
||||
}),
|
||||
characterTags: item.characterTags ? item.characterTags.map((tag) => tag) : null,
|
||||
sceneTags: item.sceneTags ? item.sceneTags.map((tag) => tag) : null,
|
||||
@@ -257,6 +271,7 @@ export class BookTaskDetailService extends BaseRealmService {
|
||||
*/
|
||||
UpdateBookTaskDetailVideoMessage(bookTaskDetailId: string, videoMessage: BookTaskDetail.VideoMessage): void {
|
||||
this.transaction(() => {
|
||||
console.log("开始更新小说分镜的视频消息", bookTaskDetailId, videoMessage)
|
||||
let bookTaskDetail = this.realm.objectForPrimaryKey('BookTaskDetail', bookTaskDetailId)
|
||||
let videoMessageRes = this.realm.objectForPrimaryKey('VideoMessage', bookTaskDetailId)
|
||||
if (bookTaskDetail.videoMessage == null) {
|
||||
|
||||
Reference in New Issue
Block a user