V 3.2.3
1.优化文案处理逻辑,重构界面 2.修复批量导出草稿只能导出一个的bug 3.添加自动 推理人物 场景 方便快速生成标签 4.(聚合推文) 修复删除数据bug 5.新增推理国内转发接口(包括翻译) 6.新增文案导入时导入SRT后可手动校验一遍时间数据,简化简单过程 7.语音服务那边添加字符不生效,格式化不生效 8.优化语音服务(数据结构优化,可设置合成超时时间)
This commit is contained in:
@@ -11,6 +11,7 @@ import { OtherData } from '../../../enum/softwareEnum.js'
|
||||
import { BookBackTaskList } from '../../model/Book/BookBackTaskListModel.js'
|
||||
import { Book } from '../../../../model/book/book.js'
|
||||
import { GeneralResponse } from '../../../../model/generalResponse.js'
|
||||
import { TaskModal } from '@/model/task.js'
|
||||
const { v4: uuidv4 } = require('uuid')
|
||||
|
||||
export class BookBackTaskListService extends BaseRealmService {
|
||||
|
||||
@@ -232,7 +232,8 @@ export class BookService extends BaseRealmService {
|
||||
updateTime: new Date(),
|
||||
createTime: new Date(),
|
||||
version: version,
|
||||
imageCategory: imageCategory
|
||||
imageCategory: imageCategory,
|
||||
openVideoGenerate: false
|
||||
}
|
||||
|
||||
// 添加任务
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import Realm from 'realm'
|
||||
import { isEmpty, cloneDeep } from 'lodash'
|
||||
import { OptionType } from '@/define/enum/option'
|
||||
import { BaseSoftWareService } from './softwareBasic'
|
||||
import { OptionModel } from '@/model/option/option'
|
||||
|
||||
export class OptionRealmService extends BaseSoftWareService {
|
||||
static instance: OptionRealmService | null = null
|
||||
declare realm: Realm
|
||||
private constructor() {
|
||||
super()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前实例对象,为空则创建一个新的
|
||||
* @returns
|
||||
*/
|
||||
public static async getInstance() {
|
||||
if (OptionRealmService.instance === null) {
|
||||
OptionRealmService.instance = new OptionRealmService()
|
||||
await super.getInstance()
|
||||
}
|
||||
await OptionRealmService.instance.open()
|
||||
return OptionRealmService.instance
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的Option,通过key,不存在返回null
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
public GetOptionByKey(key: string): OptionModel.OptionItem | null {
|
||||
if (isEmpty(key)) {
|
||||
return null
|
||||
}
|
||||
let res = this.realm.objects('Options').filtered(`key = "${key}"`);
|
||||
|
||||
if (res.length > 0) {
|
||||
let resData = Array.from(res).map((item) => {
|
||||
let resObj = {
|
||||
...item
|
||||
}
|
||||
return cloneDeep(resObj)
|
||||
})
|
||||
return resData[0] as OptionModel.OptionItem
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改指定的Option,通过key,不存在则创建
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public ModifyOptionByKey(key: string, value: string, type: OptionType = OptionType.STRING) {
|
||||
if (isEmpty(key)) {
|
||||
return false
|
||||
}
|
||||
let option = this.realm.objectForPrimaryKey('Options', key);
|
||||
if (option) {
|
||||
this.realm.write(() => {
|
||||
option.value = value;
|
||||
option.type = type;
|
||||
})
|
||||
} else {
|
||||
this.realm.write(() => {
|
||||
this.realm.create('Options', {
|
||||
key: key,
|
||||
value: value,
|
||||
type: type
|
||||
})
|
||||
})
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user