V 3.2.2
1. 文案处理后端服务迁移(此版本之前的后端服务持续到12月1日) 2. 新增默认动图方式 3. (聚合推文)实现原创分类的图生视频(runway,luma,可灵) 4. 修复软件内配音 5. 删除旧的原创生图(原创,SD反推,MJ反推等操作在聚合推文中) 6. 导出剪映适配(视频) 7. 新增四个单句推理模式
This commit is contained in:
@@ -7,6 +7,7 @@ import path from 'path'
|
||||
import {
|
||||
BookTaskDetailModel,
|
||||
MJMessage,
|
||||
VideoMessage,
|
||||
ReversePrompt,
|
||||
SDConfig,
|
||||
Subtitle,
|
||||
@@ -204,6 +205,50 @@ const migration = (oldRealm: Realm, newRealm: Realm) => {
|
||||
newBookTask[i].cacheImageList = undefined
|
||||
}
|
||||
}
|
||||
if (oldRealm.schemaVersion < 30) {
|
||||
const oldBookTask = oldRealm.objects('BookTaskDetail')
|
||||
const newBookTask = newRealm.objects('BookTaskDetail')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].generateVideoPath = undefined
|
||||
}
|
||||
}
|
||||
if (oldRealm.schemaVersion < 31) {
|
||||
const oldBookTask = oldRealm.objects('BookTask')
|
||||
const newBookTask = newRealm.objects('BookTask')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].openVideoGenerate = false
|
||||
}
|
||||
}
|
||||
if (oldRealm.schemaVersion < 34) {
|
||||
const oldBookTask = oldRealm.objects('BookTaskDetail')
|
||||
const newBookTask = newRealm.objects('BookTaskDetail')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].videoMessage = undefined
|
||||
}
|
||||
}
|
||||
if (oldRealm.schemaVersion < 35) {
|
||||
const oldBookTask = oldRealm.objects('VideoMessage')
|
||||
const newBookTask = newRealm.objects('VideoMessage')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].videoMessage = undefined
|
||||
}
|
||||
}
|
||||
if (oldRealm.schemaVersion < 36) {
|
||||
const oldBookTask = oldRealm.objects('VideoMessage')
|
||||
const newBookTask = newRealm.objects('VideoMessage')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].options = undefined
|
||||
}
|
||||
}
|
||||
if (oldRealm.schemaVersion < 37) {
|
||||
const oldBookTask = oldRealm.objects('VideoMessage')
|
||||
const newBookTask = newRealm.objects('VideoMessage')
|
||||
for (let i = 0; i < oldBookTask.length; i++) {
|
||||
newBookTask[i].runwayOptions = oldBookTask[i].options;
|
||||
newBookTask[i].lumaOptions = undefined;
|
||||
newBookTask[i].klingOptions = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class BaseRealmService extends BaseService {
|
||||
@@ -242,10 +287,11 @@ export class BaseRealmService extends BaseService {
|
||||
WebuiConfig,
|
||||
BookTaskModel,
|
||||
ReversePrompt,
|
||||
BookTaskDetailModel
|
||||
BookTaskDetailModel,
|
||||
VideoMessage
|
||||
],
|
||||
path: this.dbpath,
|
||||
schemaVersion: 29,
|
||||
schemaVersion: 37,
|
||||
migration: migration
|
||||
}
|
||||
this.realm = await Realm.open(config)
|
||||
|
||||
@@ -10,6 +10,7 @@ import { BookTaskDetailModel, ReversePrompt } from '../../model/Book/bookTaskDet
|
||||
const { v4: uuidv4 } = require('uuid')
|
||||
import { Book } from "../../../../model/book/book"
|
||||
import { GeneralResponse } from '../../../../model/generalResponse.js'
|
||||
import { BookTaskDetail } from '@/model/book/bookTaskDetail'
|
||||
|
||||
let dbPath = path.resolve(define.db_path, 'book.realm')
|
||||
|
||||
@@ -65,6 +66,7 @@ export class BookTaskDetailService extends BaseRealmService {
|
||||
let resObj = {
|
||||
...item,
|
||||
videoPath: JoinPath(define.project_path, item.videoPath),
|
||||
generateVideoPath: JoinPath(define.project_path, item.generateVideoPath),
|
||||
audioPath: JoinPath(define.project_path, item.audioPath),
|
||||
oldImage: JoinPath(define.project_path, item.oldImage),
|
||||
outImagePath: JoinPath(define.project_path, item.outImagePath),
|
||||
@@ -80,6 +82,11 @@ export class BookTaskDetailService extends BaseRealmService {
|
||||
}
|
||||
}),
|
||||
mjMessage: item.mjMessage ? item.mjMessage.toJSON() : null,
|
||||
videoMessage: item.videoMessage ? item.videoMessage.toJSON() : null,
|
||||
}
|
||||
// 不是网络地址,并且存在,进行地址的拼接
|
||||
if (resObj.videoMessage && resObj.videoMessage.imageUrl && !isEmpty(resObj.videoMessage.imageUrl) && !(resObj.videoMessage.imageUrl as string).startsWith("http")) {
|
||||
resObj.videoMessage.imageUrl = JoinPath(define.project_path, resObj.videoMessage.imageUrl as string);
|
||||
}
|
||||
return cloneDeep(resObj)
|
||||
})
|
||||
@@ -93,6 +100,24 @@ export class BookTaskDetailService extends BaseRealmService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回指定的小说分镜的指定的属性
|
||||
* @param bookTaskDetailId 小说分镜的ID
|
||||
* @param property 小说属性名字
|
||||
* @returns
|
||||
*/
|
||||
GetBookTaskDetailProperty(bookTaskDetailId: string, property: string) {
|
||||
let bookTaskDetail = this.GetBookTaskDetailDataById(bookTaskDetailId);
|
||||
if (bookTaskDetail == null) {
|
||||
throw new Error('未找到对应的小说任务详细信息 ' + bookTaskDetailId)
|
||||
}
|
||||
if (bookTaskDetail.hasOwnProperty(property)) {
|
||||
return bookTaskDetail[property]
|
||||
} else {
|
||||
throw new Error(`未找到对应的属性 ${property}`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID获取指定的小说任务分镜详细数据
|
||||
* @param bookTaskDetailId
|
||||
@@ -213,6 +238,33 @@ export class BookTaskDetailService extends BaseRealmService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新小说分镜的视频消息
|
||||
* @param bookTaskDetailId
|
||||
* @param videoMessage
|
||||
*/
|
||||
UpdateBookTaskDetailVideoMessage(bookTaskDetailId: string, videoMessage: BookTaskDetail.VideoMessage): void {
|
||||
this.transaction(() => {
|
||||
let bookTaskDetail = this.realm.objectForPrimaryKey('BookTaskDetail', bookTaskDetailId)
|
||||
let videoMessageRes = this.realm.objectForPrimaryKey('VideoMessage', bookTaskDetailId)
|
||||
if (bookTaskDetail.videoMessage == null) {
|
||||
// 新增
|
||||
videoMessage.id = bookTaskDetailId
|
||||
bookTaskDetail.videoMessage = videoMessage
|
||||
} else {
|
||||
for (const key in videoMessage) {
|
||||
if (key == "id") {
|
||||
continue;
|
||||
}
|
||||
if (key == "imageUrl" && videoMessage[key] != null && !videoMessage[key].startsWith("http")) {
|
||||
videoMessage[key] = path.relative(define.project_path, videoMessage[key])
|
||||
}
|
||||
videoMessageRes[key] = videoMessage[key]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新指定ID的反推提示词数据
|
||||
* @param bookTaskDetailId 分镜数据的ID
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
} from '../../model/SoftWare/mjSetting'
|
||||
import { MJImageType, MJRobotType } from '../../../enum/mjEnum'
|
||||
import { PresetModel } from '../../model/SoftWare/preset'
|
||||
import { OptionsModel } from '../../model/SoftWare/options'
|
||||
const { v4: uuidv4 } = require('uuid')
|
||||
|
||||
let dbPath = path.resolve(define.db_path, 'software.realm')
|
||||
@@ -167,6 +168,8 @@ const migration = (oldRealm: Realm, newRealm: Realm) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
if (oldRealm.schemaVersion < 25) {
|
||||
}
|
||||
}
|
||||
|
||||
export class BaseSoftWareService extends BaseService {
|
||||
@@ -203,10 +206,11 @@ export class BaseSoftWareService extends BaseService {
|
||||
RemoteMJModel,
|
||||
APIMjModel,
|
||||
MjSettingModel,
|
||||
PresetModel
|
||||
PresetModel,
|
||||
OptionsModel
|
||||
],
|
||||
path: dbPath,
|
||||
schemaVersion: 24, // 当前版本号
|
||||
schemaVersion: 25, // 当前版本号
|
||||
migration: migration
|
||||
}
|
||||
// 判断当前全局是不是又当前这个
|
||||
|
||||
Reference in New Issue
Block a user