配置关闭刮削开关

This commit is contained in:
jianzhichu
2026-03-14 19:29:58 +08:00
parent dbf98c781d
commit 21e1aca7b5
5 changed files with 25 additions and 8 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ namespace dy.net
private static readonly string DefaultListenUrl = "http://*:10101";
private const string SpaRootPath = "app/dist";
private const string SpaSourcePath = "app/";
private const string SwaggerDocTitle = "dy.net WebApi Docs";
private const string SwaggerDocTitle = "dysync.net WebApi Docs";
/// <summary>
///
+7
View File
@@ -200,6 +200,10 @@
<a-radio-button :value="265">H265</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item label="关闭刮削" name="CloseNfo">
<a-switch v-model:checked="formState.CloseNfo" />
</a-form-item>
</div>
<!-- 操作按钮 -->
@@ -321,6 +325,7 @@ interface FormState {
KeepDynamicVideo: boolean; // 补充原有缺失字段
OnlySyncNew: boolean;
VideoEncoder: number;
CloseNfo:boolean;
}
// 表单初始数据
@@ -345,6 +350,7 @@ const formState: UnwrapRef<FormState> = reactive({
KeepDynamicVideo: false, // 初始化缺失字段
OnlySyncNew: false,
VideoEncoder: 264,
CloseNfo:false
});
// 实时计算完整模板
@@ -419,6 +425,7 @@ const getConfig = () => {
KeepDynamicVideo: res.data.keepDynamicVideo || false, // 补充赋值
OnlySyncNew: res.data.onlySyncNew,
VideoEncoder: res.data.videoEncoder,
CloseNfo:res.data.closeNfo
});
tagData.value = JSON.parse(res.data.priorityLevel || '[]');
+7 -5
View File
@@ -687,11 +687,11 @@ namespace dy.net.job
//动态视频生成nfo
if (cate != null && (VideoType == VideoTypeEnum.dy_mix || VideoType == VideoTypeEnum.dy_series))
{
NfoFileGenerator.GenerateVideoNfoFile(dynamicVideo, cate.Name);
NfoFileGenerator.GenerateVideoNfoFile(config.CloseNfo,dynamicVideo, cate.Name);
}
else
{
NfoFileGenerator.GenerateVideoNfoFile(dynamicVideo);
NfoFileGenerator.GenerateVideoNfoFile(config.CloseNfo, dynamicVideo);
}
videos.Add(dynamicVideo);
syncCount++;
@@ -1471,10 +1471,12 @@ namespace dy.net.job
{
if (cate != null && (VideoType == VideoTypeEnum.dy_mix || VideoType == VideoTypeEnum.dy_series))
{
NfoFileGenerator.GenerateVideoNfoFile(video, cate.Name);
NfoFileGenerator.GenerateVideoNfoFile(config.CloseNfo, video, cate.Name);
}
else
{
NfoFileGenerator.GenerateVideoNfoFile(config.CloseNfo, video);
}
// 生成NFO文件,动态视频 合成后重新生成,不在这里生成nfo
NfoFileGenerator.GenerateVideoNfoFile(video);
}
return video;
+5
View File
@@ -115,6 +115,11 @@ namespace dy.net.model.entity
/// </summary>
[SugarColumn(IsNullable = true)]
public int? VideoEncoder { get; set; }
/// <summary>
/// 是否不启用刮削
/// </summary>
[SugarColumn(IsNullable = true)]
public bool CloseNfo { get; set; }
}
}
+4 -1
View File
@@ -16,11 +16,14 @@ namespace dy.net.utils
/// 生成NFO文件
/// NFO文件包含视频的元数据信息,如标题、作者、封面等
/// </summary>
/// <param name="closeNfo">是否关闭刮削生成nfo</param>
/// <param name="video">视频信息</param>
/// <param name="tvShowTitle"></param>
/// <returns>一个表示异步操作的任务</returns>
public static void GenerateVideoNfoFile(DouyinVideo video, string tvShowTitle = "")
public static void GenerateVideoNfoFile(bool closeNfo,DouyinVideo video, string tvShowTitle = "")
{
if (closeNfo) return;
try
{
if (video.OnlyImgOrOnlyMp3) return;//图片,音频不刮削