已知问题优化
This commit is contained in:
@@ -73,54 +73,6 @@ namespace dy.net.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//private IActionResult PlayViedo(DouyinVideo viedo)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// // 1. 拼接完整物理路径(配置路径 + 文件名)
|
|
||||||
// string videoFullPath = viedo.VideoSavePath;
|
|
||||||
|
|
||||||
// // 2. 验证文件是否存在
|
|
||||||
// if (!System.IO.File.Exists(videoFullPath))
|
|
||||||
// {
|
|
||||||
// return ApiResult.Fail($"视频文件不存在:{videoFullPath}");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 3. 获取文件信息(大小、类型)
|
|
||||||
// var fileInfo = new FileInfo(videoFullPath);
|
|
||||||
// long fileSize = fileInfo.Length;
|
|
||||||
// string contentType = GetContentType(videoFullPath); // 自动识别视频 MIME 类型
|
|
||||||
|
|
||||||
// // 4. 处理分片请求(前端视频标签自动发起,支持断点续传)
|
|
||||||
// if (Request.Headers.ContainsKey("Range") && long.TryParse(Request.Headers.Range.ToString().Split('=')[1].Split('-')[0], out long start))
|
|
||||||
// {
|
|
||||||
// // 分片起始位置(前端请求的起始字节)
|
|
||||||
// long end = Math.Min(start + 1024 * 1024 * 2, fileSize - 1); // 每片 2MB(可调整)
|
|
||||||
// long chunkSize = end - start + 1;
|
|
||||||
|
|
||||||
// // 5. 设置分片响应头
|
|
||||||
// Response.StatusCode = StatusCodes.Status206PartialContent;
|
|
||||||
// Response.Headers.Add("Content-Range", $"bytes {start}-{end}/{fileSize}");
|
|
||||||
// Response.Headers.Add("Accept-Ranges", "bytes");
|
|
||||||
// Response.Headers.Add("Content-Length", chunkSize.ToString());
|
|
||||||
|
|
||||||
// // 6. 读取分片并返回流
|
|
||||||
// var stream = new FileStream(
|
|
||||||
// videoFullPath,
|
|
||||||
// FileMode.Open,
|
|
||||||
// FileAccess.Read,
|
|
||||||
// FileShare.Read,
|
|
||||||
// bufferSize: 4096,
|
|
||||||
// useAsync: true);
|
|
||||||
|
|
||||||
// stream.Seek(start, SeekOrigin.Begin);
|
|
||||||
// return new FileStreamResult(stream, contentType);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// // 完整文件请求(兼容旧浏览器)
|
|
||||||
// return PhysicalFile(videoFullPath, contentType, enableRangeProcessing: true);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 抖音视频播放接口(优化版)
|
/// 抖音视频播放接口(优化版)
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ namespace dy.net
|
|||||||
//commonService.UpdateAllCookieSyncedToZero();
|
//commonService.UpdateAllCookieSyncedToZero();
|
||||||
|
|
||||||
await commonService.UpdateFollowedSavePathAsync();
|
await commonService.UpdateFollowedSavePathAsync();
|
||||||
|
await commonService.UpdateImageVideoSavePath();
|
||||||
|
|
||||||
// 初始化Cookie
|
// 初始化Cookie
|
||||||
var cookieService = services.GetRequiredService<DouyinCookieService>();
|
var cookieService = services.GetRequiredService<DouyinCookieService>();
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
<SelfContained>false</SelfContained>
|
<SelfContained>false</SelfContained>
|
||||||
<!--<DockerArch>x86</DockerArch>-->
|
<!--<DockerArch>x86</DockerArch>-->
|
||||||
<!--<DockerArch>arm</DockerArch> -->
|
<!--<DockerArch>arm</DockerArch> -->
|
||||||
<!--<DockerCoreVersion>2.1.2</DockerCoreVersion>-->
|
<!--<DockerCoreVersion>2.1.5</DockerCoreVersion>-->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl>
|
<_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl>
|
||||||
<History>True|2026-02-25T14:29:25.1875055Z||;True|2026-02-25T22:28:53.3053713+08:00||;True|2026-02-12T19:27:23.6648031+08:00||;True|2026-02-12T19:25:10.7424743+08:00||;True|2026-02-12T17:33:31.2163848+08:00||;True|2026-02-12T17:16:08.2015031+08:00||;False|2026-02-12T17:16:02.9041381+08:00||;True|2026-02-12T17:12:44.8082909+08:00||;True|2026-02-12T17:04:22.1666828+08:00||;True|2026-02-12T17:03:04.2760582+08:00||;True|2026-02-12T16:52:01.7403172+08:00||;True|2026-02-12T16:49:57.7070533+08:00||;False|2026-02-12T16:49:53.4063422+08:00||;True|2026-02-12T16:43:13.2040344+08:00||;False|2026-02-12T16:42:58.3321319+08:00||;True|2026-02-12T16:29:28.6386479+08:00||;True|2026-02-12T16:19:46.9195592+08:00||;True|2026-02-12T14:32:25.3192428+08:00||;True|2026-02-12T12:18:02.1864306+08:00||;True|2026-02-11T20:39:23.8084775+08:00||;True|2026-02-11T20:37:06.6507806+08:00||;True|2026-02-11T20:04:19.1839991+08:00||;True|2026-02-10T21:59:37.6685615+08:00||;True|2026-02-10T15:43:23.5038986+08:00||;True|2026-02-10T14:42:48.6214001+08:00||;True|2026-02-06T23:15:19.0037070+08:00||;True|2026-02-06T22:52:30.1006808+08:00||;True|2026-02-06T22:49:02.0056235+08:00||;True|2026-02-06T22:45:30.6355735+08:00||;False|2026-02-06T22:45:25.7210123+08:00||;True|2026-02-06T22:38:37.6994272+08:00||;True|2026-02-06T22:14:47.8146805+08:00||;True|2026-02-03T22:34:12.3588819+08:00||;True|2026-02-03T22:20:08.9945012+08:00||;True|2026-02-03T21:06:17.7655312+08:00||;True|2026-02-02T23:24:09.9134119+08:00||;True|2026-02-02T23:21:52.3235946+08:00||;False|2026-02-02T23:21:47.1386702+08:00||;True|2026-02-02T23:20:46.6277206+08:00||;False|2026-02-02T23:20:40.3158947+08:00||;True|2026-02-02T22:55:39.4268475+08:00||;True|2026-02-01T21:34:30.5989260+08:00||;True|2026-02-01T21:30:20.7556066+08:00||;True|2026-01-30T21:56:47.1840381+08:00||;True|2026-01-28T22:01:00.8412391+08:00||;False|2026-01-28T21:49:29.1242233+08:00||;True|2026-01-28T21:48:26.1707204+08:00||;True|2026-01-28T21:48:05.8291762+08:00||;False|2026-01-28T21:48:01.1596391+08:00||;True|2026-01-28T21:37:59.4831763+08:00||;False|2026-01-28T21:37:53.5855464+08:00||;True|2026-01-28T21:27:51.1872828+08:00||;True|2026-01-28T13:01:14.1677037+08:00||;True|2026-01-28T12:36:45.7819776+08:00||;True|2026-01-28T12:09:15.6540204+08:00||;True|2026-01-28T12:08:40.0490617+08:00||;True|2026-01-28T11:58:55.4078870+08:00||;True|2026-01-27T22:37:03.3304942+08:00||;True|2026-01-27T22:05:40.4316281+08:00||;True|2026-01-26T22:30:43.5083924+08:00||;False|2026-01-26T22:30:33.7355213+08:00||;True|2026-01-26T22:26:26.0218548+08:00||;True|2026-01-26T22:21:32.3171217+08:00||;True|2026-01-26T22:20:40.3916780+08:00||;True|2026-01-26T22:16:19.1017273+08:00||;True|2026-01-26T22:13:34.2028883+08:00||;True|2026-01-26T21:46:23.7117812+08:00||;True|2026-01-26T21:41:19.6963033+08:00||;True|2026-01-25T21:27:13.9893777+08:00||;True|2026-01-24T21:45:22.8493624+08:00||;True|2026-01-24T21:31:35.4635265+08:00||;True|2026-01-24T21:27:31.3098506+08:00||;True|2026-01-24T15:47:01.6934638+08:00||;True|2026-01-24T15:32:35.6316009+08:00||;True|2026-01-24T15:16:28.7216639+08:00||;True|2026-01-23T22:14:26.8066324+08:00||;True|2026-01-23T13:36:48.4086406+08:00||;True|2026-01-23T13:30:27.2924204+08:00||;True|2026-01-23T13:02:53.3219368+08:00||;True|2026-01-23T13:01:54.3466638+08:00||;True|2026-01-23T13:01:28.8560809+08:00||;True|2026-01-22T23:18:32.0400436+08:00||;True|2026-01-22T22:29:29.5746209+08:00||;True|2026-01-22T21:32:21.7284081+08:00||;True|2026-01-22T21:20:26.5985955+08:00||;False|2026-01-22T21:20:21.1372539+08:00||;True|2026-01-22T21:11:18.3771739+08:00||;True|2026-01-22T20:58:55.9862778+08:00||;True|2026-01-22T20:51:48.6699461+08:00||;False|2026-01-22T20:51:42.2079210+08:00||;True|2026-01-22T20:50:34.7280114+08:00||;True|2026-01-22T20:50:11.1588492+08:00||;True|2026-01-22T16:11:14.0626037+08:00||;True|2026-01-22T15:53:16.6377347+08:00||;True|2026-01-22T15:45:34.0935091+08:00||;True|2026-01-22T12:44:28.1577014+08:00||;True|2026-01-22T12:40:45.7449335+08:00||;True|2026-01-22T12:39:07.0683214+08:00||;True|2026-01-22T09:55:49.7086190+08:00||;True|2026-01-22T01:37:53.6972395+08:00||;</History>
|
<History>True|2026-03-13T11:03:43.3888728Z||;True|2026-03-13T19:00:46.5678455+08:00||;True|2026-03-08T20:40:39.8018016+08:00||;True|2026-03-08T20:37:16.4384198+08:00||;True|2026-03-05T22:22:59.1986039+08:00||;True|2026-03-05T21:47:10.7337653+08:00||;True|2026-03-05T21:44:09.8036238+08:00||;False|2026-03-05T21:44:03.0581762+08:00||;True|2026-03-05T18:20:17.8376341+08:00||;True|2026-03-02T21:57:32.1274356+08:00||;True|2026-02-25T22:29:25.1875055+08:00||;True|2026-02-25T22:28:53.3053713+08:00||;True|2026-02-12T19:27:23.6648031+08:00||;True|2026-02-12T19:25:10.7424743+08:00||;True|2026-02-12T17:33:31.2163848+08:00||;True|2026-02-12T17:16:08.2015031+08:00||;False|2026-02-12T17:16:02.9041381+08:00||;True|2026-02-12T17:12:44.8082909+08:00||;True|2026-02-12T17:04:22.1666828+08:00||;True|2026-02-12T17:03:04.2760582+08:00||;True|2026-02-12T16:52:01.7403172+08:00||;True|2026-02-12T16:49:57.7070533+08:00||;False|2026-02-12T16:49:53.4063422+08:00||;True|2026-02-12T16:43:13.2040344+08:00||;False|2026-02-12T16:42:58.3321319+08:00||;True|2026-02-12T16:29:28.6386479+08:00||;True|2026-02-12T16:19:46.9195592+08:00||;True|2026-02-12T14:32:25.3192428+08:00||;True|2026-02-12T12:18:02.1864306+08:00||;True|2026-02-11T20:39:23.8084775+08:00||;True|2026-02-11T20:37:06.6507806+08:00||;True|2026-02-11T20:04:19.1839991+08:00||;True|2026-02-10T21:59:37.6685615+08:00||;True|2026-02-10T15:43:23.5038986+08:00||;True|2026-02-10T14:42:48.6214001+08:00||;True|2026-02-06T23:15:19.0037070+08:00||;True|2026-02-06T22:52:30.1006808+08:00||;True|2026-02-06T22:49:02.0056235+08:00||;True|2026-02-06T22:45:30.6355735+08:00||;False|2026-02-06T22:45:25.7210123+08:00||;True|2026-02-06T22:38:37.6994272+08:00||;True|2026-02-06T22:14:47.8146805+08:00||;True|2026-02-03T22:34:12.3588819+08:00||;True|2026-02-03T22:20:08.9945012+08:00||;True|2026-02-03T21:06:17.7655312+08:00||;True|2026-02-02T23:24:09.9134119+08:00||;True|2026-02-02T23:21:52.3235946+08:00||;False|2026-02-02T23:21:47.1386702+08:00||;True|2026-02-02T23:20:46.6277206+08:00||;False|2026-02-02T23:20:40.3158947+08:00||;True|2026-02-02T22:55:39.4268475+08:00||;True|2026-02-01T21:34:30.5989260+08:00||;True|2026-02-01T21:30:20.7556066+08:00||;True|2026-01-30T21:56:47.1840381+08:00||;True|2026-01-28T22:01:00.8412391+08:00||;False|2026-01-28T21:49:29.1242233+08:00||;True|2026-01-28T21:48:26.1707204+08:00||;True|2026-01-28T21:48:05.8291762+08:00||;False|2026-01-28T21:48:01.1596391+08:00||;True|2026-01-28T21:37:59.4831763+08:00||;False|2026-01-28T21:37:53.5855464+08:00||;True|2026-01-28T21:27:51.1872828+08:00||;True|2026-01-28T13:01:14.1677037+08:00||;True|2026-01-28T12:36:45.7819776+08:00||;True|2026-01-28T12:09:15.6540204+08:00||;True|2026-01-28T12:08:40.0490617+08:00||;True|2026-01-28T11:58:55.4078870+08:00||;True|2026-01-27T22:37:03.3304942+08:00||;True|2026-01-27T22:05:40.4316281+08:00||;True|2026-01-26T22:30:43.5083924+08:00||;False|2026-01-26T22:30:33.7355213+08:00||;True|2026-01-26T22:26:26.0218548+08:00||;True|2026-01-26T22:21:32.3171217+08:00||;True|2026-01-26T22:20:40.3916780+08:00||;True|2026-01-26T22:16:19.1017273+08:00||;True|2026-01-26T22:13:34.2028883+08:00||;True|2026-01-26T21:46:23.7117812+08:00||;True|2026-01-26T21:41:19.6963033+08:00||;True|2026-01-25T21:27:13.9893777+08:00||;True|2026-01-24T21:45:22.8493624+08:00||;True|2026-01-24T21:31:35.4635265+08:00||;True|2026-01-24T21:27:31.3098506+08:00||;True|2026-01-24T15:47:01.6934638+08:00||;True|2026-01-24T15:32:35.6316009+08:00||;True|2026-01-24T15:16:28.7216639+08:00||;True|2026-01-23T22:14:26.8066324+08:00||;True|2026-01-23T13:36:48.4086406+08:00||;True|2026-01-23T13:30:27.2924204+08:00||;True|2026-01-23T13:02:53.3219368+08:00||;True|2026-01-23T13:01:54.3466638+08:00||;True|2026-01-23T13:01:28.8560809+08:00||;True|2026-01-22T23:18:32.0400436+08:00||;True|2026-01-22T22:29:29.5746209+08:00||;True|2026-01-22T21:32:21.7284081+08:00||;True|2026-01-22T21:20:26.5985955+08:00||;False|2026-01-22T21:20:21.1372539+08:00||;True|2026-01-22T21:11:18.3771739+08:00||;True|2026-01-22T20:58:55.9862778+08:00||;True|2026-01-22T20:51:48.6699461+08:00||;False|2026-01-22T20:51:42.2079210+08:00||;</History>
|
||||||
<LastFailureDetails />
|
<LastFailureDetails />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -95,8 +95,8 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取,
|
|||||||
|
|
||||||
| 镜像标签 | 架构 |
|
| 镜像标签 | 架构 |
|
||||||
| ----------------- | -------------- |
|
| ----------------- | -------------- |
|
||||||
| `beta_2.1.2` | x86_64 (amd64) |
|
| `beta_2.1.5` | x86_64 (amd64) |
|
||||||
| `arm_2.1.2` | ARM64 |
|
| `arm_2.1.5` | ARM64 |
|
||||||
|
|
||||||
|
|
||||||
### 构建命令示例
|
### 构建命令示例
|
||||||
@@ -113,7 +113,7 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取,
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
dysync:
|
dysync:
|
||||||
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.1.2
|
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.1.5
|
||||||
container_name: dysync2026 # 容器名称
|
container_name: dysync2026 # 容器名称
|
||||||
restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止
|
restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
<!-- 优化查询区域:调整布局,时间、博主名称、标题放一行,宽度自适应 -->
|
<!-- 优化查询区域:调整布局,时间、博主名称、标题放一行,宽度自适应 -->
|
||||||
<div class="query-container">
|
<div class="query-container">
|
||||||
<a-form layout="inline" :model="quaryData" class="query-form">
|
<a-form layout="inline" :model="quaryData" class="query-form">
|
||||||
|
|
||||||
<!-- 第一行:时间选择器组 + 博主名称 + 标题(合并为一行,自适应宽度) -->
|
<!-- 第一行:时间选择器组 + 博主名称 + 标题(合并为一行,自适应宽度) -->
|
||||||
<div class="form-row form-main-row">
|
<div class="form-row form-main-row">
|
||||||
|
|
||||||
<a-form-item label="同步日期" class="form-item form-item-date">
|
<a-form-item label="同步日期" class="form-item form-item-date">
|
||||||
<a-range-picker v-model:value="value1" :ranges="ranges" :locale="locale" @change="datePicked" class="range-picker" />
|
<a-range-picker v-model:value="value1" :ranges="ranges" :locale="locale" @change="datePicked" class="range-picker" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -13,7 +15,7 @@
|
|||||||
<a-range-picker v-model:value="value2" :ranges="ranges2" :locale="locale" @change="datePicked2" class="range-picker" />
|
<a-range-picker v-model:value="value2" :ranges="ranges2" :locale="locale" @change="datePicked2" class="range-picker" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="博主名称" ref="author" name="author" class="form-item form-item-input">
|
<a-form-item label="博主" ref="author" name="author" class="form-item form-item-input">
|
||||||
<a-input v-model:value="quaryData.author" class="query-input" placeholder="请输入博主名称" />
|
<a-input v-model:value="quaryData.author" class="query-input" placeholder="请输入博主名称" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="标题" ref="title" name="title" class="form-item form-item-input">
|
<a-form-item label="标题" ref="title" name="title" class="form-item form-item-input">
|
||||||
@@ -23,6 +25,9 @@
|
|||||||
|
|
||||||
<!-- 第二行:单选组 + 按钮组 -->
|
<!-- 第二行:单选组 + 按钮组 -->
|
||||||
<div class="form-row form-actions-row">
|
<div class="form-row form-actions-row">
|
||||||
|
<a-form-item class="form-item">
|
||||||
|
<a-select ref="select" v-model:value="quaryData.cookieId" style="width: 120px" :options="cookies"></a-select>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="视频类型" class="form-item radio-group-item">
|
<a-form-item label="视频类型" class="form-item radio-group-item">
|
||||||
<a-radio-group v-model:value="quaryData.viedoType" button-style="solid" @change="onViedoTypeChanged" class="video-type-radio">
|
<a-radio-group v-model:value="quaryData.viedoType" button-style="solid" @change="onViedoTypeChanged" class="video-type-radio">
|
||||||
<a-radio-button value="*">全部</a-radio-button>
|
<a-radio-button value="*">全部</a-radio-button>
|
||||||
@@ -40,22 +45,22 @@
|
|||||||
<SearchOutlined />查询
|
<SearchOutlined />查询
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-form-item class="form-item batch-operation-item" style="margin-left:20px;">
|
<a-form-item class="form-item batch-operation-item" style="margin-left:20px;">
|
||||||
<a-switch v-model:checked="isBatchMode" checked-children="批量操作" un-checked-children="批量操作" class="batch-switch" />
|
<a-switch v-model:checked="isBatchMode" checked-children="批量" un-checked-children="批量" class="batch-switch" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item class="form-item button-group-item">
|
<a-form-item class="form-item button-group-item">
|
||||||
<a-space size="middle" class="button-group">
|
<a-space size="middle" class="button-group">
|
||||||
<a-button success @click="handleBatchShare" class="delete-button" v-if="isBatchMode" :disabled="selectedRowKeys.length === 0 || isSyncing">
|
<!-- <a-button success @click="handleBatchShare" class="delete-button" v-if="isBatchMode" :disabled="selectedRowKeys.length === 0 || isSyncing">
|
||||||
<ShareAltOutlined />
|
<ShareAltOutlined />
|
||||||
批量分享
|
批量分享
|
||||||
</a-button>
|
</a-button> -->
|
||||||
<a-button danger @click="handleBatchSync" class="delete-button" v-if="isBatchMode" :disabled="selectedRowKeys.length === 0 || isSyncing">
|
<a-button danger @click="handleBatchSync" class="delete-button" v-if="isBatchMode" :disabled="selectedRowKeys.length === 0 || isSyncing">
|
||||||
<SyncOutlined />
|
<SyncOutlined />
|
||||||
重新下载
|
重新下载
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button danger @click="handleBatchDelete" class="delete-button" v-if="isBatchMode" :disabled="selectedRowKeys.length === 0 || isSyncing">
|
<a-button danger @click="handleBatchDelete" class="delete-button" v-if="isBatchMode" :disabled="selectedRowKeys.length === 0 || isSyncing">
|
||||||
<close-outlined />
|
<close-outlined />
|
||||||
批量删除
|
永久删除
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -226,6 +231,7 @@ interface QuaryParam {
|
|||||||
authorId: string;
|
authorId: string;
|
||||||
sortField?: string; // 📌 新增:排序字段
|
sortField?: string; // 📌 新增:排序字段
|
||||||
sortOrder?: string; // 📌 新增:排序方向(asc/desc)
|
sortOrder?: string; // 📌 新增:排序方向(asc/desc)
|
||||||
|
cookieId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 引入dayjs中文包
|
// 引入dayjs中文包
|
||||||
@@ -412,6 +418,7 @@ const quaryData: UnwrapRef<QuaryParam> = reactive({
|
|||||||
fileHash: '',
|
fileHash: '',
|
||||||
sortField: 'createTime', // 📌 默认排序字段
|
sortField: 'createTime', // 📌 默认排序字段
|
||||||
sortOrder: 'desc', // 📌 默认降序
|
sortOrder: 'desc', // 📌 默认降序
|
||||||
|
cookieId: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 分页配置
|
// 分页配置
|
||||||
@@ -570,6 +577,29 @@ const handleTableChange = (paginationObj: any, filters: any, sorter: any) => {
|
|||||||
GetRecords();
|
GetRecords();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const cookies = ref([]);
|
||||||
|
const getCookies = () => {
|
||||||
|
useApiStore()
|
||||||
|
.CookiePageList({})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.data.length > 0) {
|
||||||
|
cookies.value = res.data.data.map((item) => {
|
||||||
|
return {
|
||||||
|
value: item['id'] ?? '',
|
||||||
|
label: item['userName'] ?? '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
cookies.value.unshift({
|
||||||
|
value: '', // 全部对应的 value 为空字符串
|
||||||
|
label: '全部', // 显示的文本,可根据需求修改
|
||||||
|
});
|
||||||
|
|
||||||
|
quaryData.cookieId = cookies.value[0].value;
|
||||||
|
GetRecords();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/** 立即同步 */
|
/** 立即同步 */
|
||||||
const StartNow = () => {
|
const StartNow = () => {
|
||||||
if (isSyncing.value) return;
|
if (isSyncing.value) return;
|
||||||
@@ -1008,7 +1038,7 @@ const copyVideoPath = (path?: string) => {
|
|||||||
// -------------------------- 页面初始化 --------------------------
|
// -------------------------- 页面初始化 --------------------------
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// getConfig();
|
// getConfig();
|
||||||
GetRecords();
|
getCookies();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -131,7 +131,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- 核心配置:仅用核心版本号2.1.2,自动拼接前缀 -->
|
<!-- 核心配置:仅用核心版本号2.1.5,自动拼接前缀 -->
|
||||||
<!--<Target Name="DockerBuildAndPushAfterPublish" AfterTargets="Publish">
|
<!--<Target Name="DockerBuildAndPushAfterPublish" AfterTargets="Publish">
|
||||||
<Exec Command="docker build -t jianzhichu/dysync.net:beta_$(DockerCoreVersion) . && docker tag jianzhichu/dysync.net:beta_$(DockerCoreVersion) ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion) && docker push ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion)"
|
<Exec Command="docker build -t jianzhichu/dysync.net:beta_$(DockerCoreVersion) . && docker tag jianzhichu/dysync.net:beta_$(DockerCoreVersion) ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion) && docker push ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion)"
|
||||||
Condition="'$(DockerArch)' == 'x86'" />
|
Condition="'$(DockerArch)' == 'x86'" />
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ActiveDebugProfile>dy.net</ActiveDebugProfile>
|
<ActiveDebugProfile>dy.net</ActiveDebugProfile>
|
||||||
<NameOfLastUsedPublishProfile>E:\code\dysync\Properties\PublishProfiles\docker.pubxml</NameOfLastUsedPublishProfile>
|
<NameOfLastUsedPublishProfile>E:\code\dysync\Properties\PublishProfiles\fn.pubxml</NameOfLastUsedPublishProfile>
|
||||||
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||||
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
|
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -9,13 +9,14 @@ using Quartz;
|
|||||||
using Quartz.Impl;
|
using Quartz.Impl;
|
||||||
using Quartz.Spi;
|
using Quartz.Spi;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
using Serilog.Configuration;
|
||||||
|
using Serilog.Core;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Serilog.Filters;
|
using Serilog.Filters;
|
||||||
using Serilog.Formatting.Compact;
|
using Serilog.Formatting.Compact;
|
||||||
//using Serilog.Formatting.Compact;
|
//using Serilog.Formatting.Compact;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
//using Swashbuckle.AspNetCore.SwaggerGen;
|
//using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
//using Swashbuckle.AspNetCore.SwaggerUI;
|
//using Swashbuckle.AspNetCore.SwaggerUI;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
@@ -271,13 +272,13 @@ namespace dy.net.extension
|
|||||||
public static void AddQuartzService(this IServiceCollection services, string dbPath)
|
public static void AddQuartzService(this IServiceCollection services, string dbPath)
|
||||||
{
|
{
|
||||||
// 注册Job(原有逻辑,保留Scoped生命周期,符合Quartz特性)
|
// 注册Job(原有逻辑,保留Scoped生命周期,符合Quartz特性)
|
||||||
services.AddTransient<DouyinCollectSyncJob>();
|
services.AddScoped<DouyinCollectSyncJob>();
|
||||||
services.AddTransient<DouyinFavoritSyncJob>();
|
services.AddScoped<DouyinFavoritSyncJob>();
|
||||||
services.AddTransient<DouyinFollowedSyncJob>();
|
services.AddScoped<DouyinFollowedSyncJob>();
|
||||||
services.AddTransient<DouyinFollowsAndCollnectsSyncJob>();
|
services.AddScoped<DouyinFollowsAndCollnectsSyncJob>();
|
||||||
services.AddTransient<DouyinCollectCustomSyncJob>();
|
services.AddScoped<DouyinCollectCustomSyncJob>();
|
||||||
services.AddTransient<DouyinMixSyncJob>();
|
services.AddScoped<DouyinMixSyncJob>();
|
||||||
services.AddTransient<DouyinSeriesSyncJob>();
|
services.AddScoped<DouyinSeriesSyncJob>();
|
||||||
|
|
||||||
// 提前创建Quartz的SQLite连接字符串,避免重复调用
|
// 提前创建Quartz的SQLite连接字符串,避免重复调用
|
||||||
string quartzConn = CreateSqliteDBConn(dbPath);
|
string quartzConn = CreateSqliteDBConn(dbPath);
|
||||||
@@ -307,7 +308,7 @@ namespace dy.net.extension
|
|||||||
q.AwaitApplicationStarted = true;
|
q.AwaitApplicationStarted = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
services.AddTransient<DouyinQuartzJobService>();
|
services.AddScoped<DouyinQuartzJobService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -658,4 +659,25 @@ namespace dy.net.extension
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
// 第一步:定义空Sink(核心,接收日志但不处理)
|
||||||
|
public class NullSink : ILogEventSink
|
||||||
|
{
|
||||||
|
// 空实现:接收到日志事件后直接丢弃
|
||||||
|
public void Emit(LogEvent logEvent)
|
||||||
|
{
|
||||||
|
// 什么都不做,日志直接被丢弃
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 第二步:扩展方法(方便调用)
|
||||||
|
public static class NullSinkExtensions
|
||||||
|
{
|
||||||
|
public static LoggerConfiguration NullSink(this LoggerSinkConfiguration sinkConfiguration)
|
||||||
|
{
|
||||||
|
return sinkConfiguration.Sink(new NullSink());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace dy.net.job
|
|||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
if (now.Hour == 1 && now.Minute < 30)
|
if (now.Hour == 1 && now.Minute < 30)
|
||||||
{
|
{
|
||||||
LogFileCleaner.CleanOldLogFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs"), 1);
|
LogFileCleaner.CleanOldLogFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs"), 10);
|
||||||
await Task.Delay(200);
|
await Task.Delay(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-19
@@ -128,7 +128,7 @@ namespace dy.net.job
|
|||||||
/// <returns>一个表示异步操作的任务</returns>
|
/// <returns>一个表示异步操作的任务</returns>
|
||||||
public async Task Execute(IJobExecutionContext context)
|
public async Task Execute(IJobExecutionContext context)
|
||||||
{
|
{
|
||||||
|
|
||||||
// 获取应用配置
|
// 获取应用配置
|
||||||
var config = douyinCommonService.GetConfig();
|
var config = douyinCommonService.GetConfig();
|
||||||
// 在处理Cookie之前执行的预处理
|
// 在处理Cookie之前执行的预处理
|
||||||
@@ -300,7 +300,7 @@ namespace dy.net.job
|
|||||||
switch (VideoType)
|
switch (VideoType)
|
||||||
{
|
{
|
||||||
case VideoTypeEnum.dy_follows:
|
case VideoTypeEnum.dy_follows:
|
||||||
if(cookie.DownFollowd)
|
if (cookie.DownFollowd)
|
||||||
{
|
{
|
||||||
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}]开始同步...");
|
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}]开始同步...");
|
||||||
//查询关注列表开启了同步的关注
|
//查询关注列表开启了同步的关注
|
||||||
@@ -323,7 +323,7 @@ namespace dy.net.job
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VideoTypeEnum.dy_favorite:
|
case VideoTypeEnum.dy_favorite:
|
||||||
if(cookie.DownFavorite)
|
if (cookie.DownFavorite)
|
||||||
{
|
{
|
||||||
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}]开始同步...");
|
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}]开始同步...");
|
||||||
int syncCount = 0;
|
int syncCount = 0;
|
||||||
@@ -453,7 +453,8 @@ namespace dy.net.job
|
|||||||
if (videos != null && videos.Any())
|
if (videos != null && videos.Any())
|
||||||
{
|
{
|
||||||
// 保存视频信息到数据库
|
// 保存视频信息到数据库
|
||||||
await SaveVideos(cookie,videos);
|
await SaveVideos(cookie, videos);
|
||||||
|
videos.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
syncCount += syncCountx;
|
syncCount += syncCountx;
|
||||||
@@ -726,7 +727,7 @@ namespace dy.net.job
|
|||||||
return (videos, syncCount);
|
return (videos, syncCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> AutoDistinct(AppConfig config, DouyinVideo exitVideo,DouyinCookie cookie)
|
private async Task<bool> AutoDistinct(AppConfig config, DouyinVideo exitVideo, DouyinCookie cookie)
|
||||||
{
|
{
|
||||||
// 去重,检查视频是否已存在(按优先级下载)
|
// 去重,检查视频是否已存在(按优先级下载)
|
||||||
if (config.AutoDistinct)
|
if (config.AutoDistinct)
|
||||||
@@ -929,7 +930,7 @@ namespace dy.net.job
|
|||||||
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}][{item?.Author?.Nickname ?? ""}]-视频[{DouyinFileNameHelper.SanitizeLinuxFileName(item.Desc, item.AwemeId)}]下载完成.");
|
Log.Debug($"[{cookie.UserName}][{VideoType.GetDesc()}][{item?.Author?.Nickname ?? ""}]-视频[{DouyinFileNameHelper.SanitizeLinuxFileName(item.Desc, item.AwemeId)}]下载完成.");
|
||||||
}
|
}
|
||||||
// 下载视频封面
|
// 下载视频封面
|
||||||
var coverSavePath= await DownVideoCover(item, savePath, cookie, cate);
|
var coverSavePath = await DownVideoCover(item, savePath, cookie, cate);
|
||||||
// 下载作者头像
|
// 下载作者头像
|
||||||
var avatarSavePath = await DownAuthorAvatar(cookie, item);
|
var avatarSavePath = await DownAuthorAvatar(cookie, item);
|
||||||
|
|
||||||
@@ -1015,7 +1016,7 @@ namespace dy.net.job
|
|||||||
|
|
||||||
|
|
||||||
// 下载视频封面
|
// 下载视频封面
|
||||||
var coverSavePath = await DownVideoCover(item, savePath, cookie, cate);
|
var coverSavePath = await DownVideoCover(item, savePath, cookie, cate);
|
||||||
// 下载作者头像
|
// 下载作者头像
|
||||||
var avatarSavePath = await DownAuthorAvatar(cookie, item);
|
var avatarSavePath = await DownAuthorAvatar(cookie, item);
|
||||||
|
|
||||||
@@ -1106,7 +1107,7 @@ namespace dy.net.job
|
|||||||
// 提取图片URL列表
|
// 提取图片URL列表
|
||||||
List<DouyinMergeVideoDto> imageUrls = item.Images?
|
List<DouyinMergeVideoDto> imageUrls = item.Images?
|
||||||
.Where(img => img.UrlList != null && img.UrlList.Any())
|
.Where(img => img.UrlList != null && img.UrlList.Any())
|
||||||
.Select(img => new DouyinMergeVideoDto { Path = img.UrlList.FirstOrDefault(),Height=img.Height,Width=img.Width })
|
.Select(img => new DouyinMergeVideoDto { Path = img.UrlList.FirstOrDefault(), Height = img.Height, Width = img.Width })
|
||||||
.Where(img => !string.IsNullOrWhiteSpace(img.Path))
|
.Where(img => !string.IsNullOrWhiteSpace(img.Path))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
@@ -1188,7 +1189,7 @@ namespace dy.net.job
|
|||||||
var coverUrl = cate is not null && cate.CateType != VideoTypeEnum.dy_custom_collect
|
var coverUrl = cate is not null && cate.CateType != VideoTypeEnum.dy_custom_collect
|
||||||
? (item.MixInfo?.CoverUrl?.UrlList?.FirstOrDefault() ?? imageUrls.FirstOrDefault()?.Path ?? item.Music?.CoverHd?.UrlList?.FirstOrDefault())
|
? (item.MixInfo?.CoverUrl?.UrlList?.FirstOrDefault() ?? imageUrls.FirstOrDefault()?.Path ?? item.Music?.CoverHd?.UrlList?.FirstOrDefault())
|
||||||
: imageUrls.FirstOrDefault()?.Path;
|
: imageUrls.FirstOrDefault()?.Path;
|
||||||
|
|
||||||
// 下载作者头像
|
// 下载作者头像
|
||||||
var avatarSavePath = await DownAuthorAvatar(cookie, item);
|
var avatarSavePath = await DownAuthorAvatar(cookie, item);
|
||||||
|
|
||||||
@@ -1204,10 +1205,10 @@ namespace dy.net.job
|
|||||||
};
|
};
|
||||||
// 下载视频封面(使用第一张图片作为封面)
|
// 下载视频封面(使用第一张图片作为封面)
|
||||||
string coverSavePath = await DownVideoCover(coverUrl, savePath, cookie);
|
string coverSavePath = await DownVideoCover(coverUrl, savePath, cookie);
|
||||||
|
|
||||||
// 创建视频实体
|
// 创建视频实体
|
||||||
var videoEntity = await CreateVideoEntity(config,
|
var videoEntity = await CreateVideoEntity(config,
|
||||||
cookie, item, virtualBitRate, coverSavePath, fileNamefolder, avatarSavePath, null, cate);
|
cookie, item, virtualBitRate, string.IsNullOrWhiteSpace(savePath) ? coverSavePath : savePath, coverSavePath, avatarSavePath, null, cate);
|
||||||
|
|
||||||
// 特殊处理合成视频的字段
|
// 特殊处理合成视频的字段
|
||||||
videoEntity.FileHash = string.Empty; // 合成视频没有原始文件哈希
|
videoEntity.FileHash = string.Empty; // 合成视频没有原始文件哈希
|
||||||
@@ -1215,7 +1216,7 @@ namespace dy.net.job
|
|||||||
videoEntity.ViedoType = VideoType;
|
videoEntity.ViedoType = VideoType;
|
||||||
videoEntity.IsMergeVideo = 1;// 标记为图片合成视频
|
videoEntity.IsMergeVideo = 1;// 标记为图片合成视频
|
||||||
|
|
||||||
|
|
||||||
return videoEntity;
|
return videoEntity;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -1244,7 +1245,7 @@ namespace dy.net.job
|
|||||||
{
|
{
|
||||||
Log.Error(ex, $"[{cookie.UserName}][{VideoType.GetDesc()}]-批量保存视频到数据库失败");
|
Log.Error(ex, $"[{cookie.UserName}][{VideoType.GetDesc()}]-批量保存视频到数据库失败");
|
||||||
// 清理保存失败的视频文件
|
// 清理保存失败的视频文件
|
||||||
await CleanupFailedVideos(cookie,videos);
|
await CleanupFailedVideos(cookie, videos);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1258,7 +1259,7 @@ namespace dy.net.job
|
|||||||
/// <param name="cookie">用户Cookie</param>
|
/// <param name="cookie">用户Cookie</param>
|
||||||
/// <param name="cate"></param>
|
/// <param name="cate"></param>
|
||||||
/// <returns>一个表示异步操作的任务</returns>
|
/// <returns>一个表示异步操作的任务</returns>
|
||||||
protected async Task<string> DownVideoCover(Aweme item, string savePath, DouyinCookie cookie, DouyinCollectCate cate)
|
protected async Task<string> DownVideoCover(Aweme item, string savePath, DouyinCookie cookie, DouyinCollectCate cate)
|
||||||
{
|
{
|
||||||
// 定义封面URL变量
|
// 定义封面URL变量
|
||||||
string coverUrl;
|
string coverUrl;
|
||||||
@@ -1281,7 +1282,7 @@ namespace dy.net.job
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 调用下载封面的方法
|
// 调用下载封面的方法
|
||||||
return await DownVideoCover(coverUrl, savePath, cookie);
|
return await DownVideoCover(coverUrl, savePath, cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1296,7 +1297,7 @@ namespace dy.net.job
|
|||||||
if (item.Author == null) return string.Empty;
|
if (item.Author == null) return string.Empty;
|
||||||
// 优先获取高清头像
|
// 优先获取高清头像
|
||||||
var avatarUrl = item.Author.AvatarLarger?.UrlList?.FirstOrDefault() ?? item.Author.AvatarThumb?.UrlList?.FirstOrDefault();
|
var avatarUrl = item.Author.AvatarLarger?.UrlList?.FirstOrDefault() ?? item.Author.AvatarThumb?.UrlList?.FirstOrDefault();
|
||||||
if (string.IsNullOrWhiteSpace(avatarUrl)) return string.Empty;
|
if (string.IsNullOrWhiteSpace(avatarUrl)) return string.Empty;
|
||||||
|
|
||||||
// 拼接头像保存路径
|
// 拼接头像保存路径
|
||||||
var avatarSavePath = Path.Combine(GetAuthorAvatarBasePath(cookie), $"{item.Author.Uid}.jpg");
|
var avatarSavePath = Path.Combine(GetAuthorAvatarBasePath(cookie), $"{item.Author.Uid}.jpg");
|
||||||
@@ -1399,7 +1400,7 @@ namespace dy.net.job
|
|||||||
newFileName = $"{fileNameWithoutExt}-poster.jpg"; // 拼接新文件名,
|
newFileName = $"{fileNameWithoutExt}-poster.jpg"; // 拼接新文件名,
|
||||||
}
|
}
|
||||||
|
|
||||||
var coverSavePath = Path.Combine(directoryPath, newFileName);
|
var coverSavePath = Path.Combine(directoryPath, newFileName);
|
||||||
|
|
||||||
|
|
||||||
// 如果封面文件不存在,则下载
|
// 如果封面文件不存在,则下载
|
||||||
@@ -1468,9 +1469,9 @@ namespace dy.net.job
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cate != null&&(VideoType == VideoTypeEnum.dy_mix || VideoType == VideoTypeEnum.dy_series))
|
if (cate != null && (VideoType == VideoTypeEnum.dy_mix || VideoType == VideoTypeEnum.dy_series))
|
||||||
{
|
{
|
||||||
NfoFileGenerator.GenerateVideoNfoFile(video,cate.Name);
|
NfoFileGenerator.GenerateVideoNfoFile(video, cate.Name);
|
||||||
}
|
}
|
||||||
// 生成NFO文件,动态视频 合成后重新生成,不在这里生成nfo
|
// 生成NFO文件,动态视频 合成后重新生成,不在这里生成nfo
|
||||||
NfoFileGenerator.GenerateVideoNfoFile(video);
|
NfoFileGenerator.GenerateVideoNfoFile(video);
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
public string? SortOrder { get; set; }
|
public string? SortOrder { get; set; }
|
||||||
|
|
||||||
|
public string? CookieId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ namespace dy.net.repository
|
|||||||
.WhereIF(start2.HasValue, x => x.CreateTime >= start2.Value)
|
.WhereIF(start2.HasValue, x => x.CreateTime >= start2.Value)
|
||||||
.WhereIF(end2.HasValue, x => x.CreateTime <= end2.Value)
|
.WhereIF(end2.HasValue, x => x.CreateTime <= end2.Value)
|
||||||
.WhereIF(enumviedoType.HasValue, x => x.ViedoType == enumviedoType)
|
.WhereIF(enumviedoType.HasValue, x => x.ViedoType == enumviedoType)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(dto.CookieId),x=>x.CookieId==dto.CookieId)
|
||||||
.WhereIF(dto.ViedoType == "4", x => x.IsMergeVideo == 1);
|
.WhereIF(dto.ViedoType == "4", x => x.IsMergeVideo == 1);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -223,6 +223,25 @@ namespace dy.net.service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateImageVideoSavePath()
|
||||||
|
{
|
||||||
|
var exist = await sqlSugarClient.Queryable<DouyinVideo>().Where(x => x.IsMergeVideo == 1 && x.VideoSavePath.EndsWith("-poster.jpg")).AnyAsync();
|
||||||
|
if (exist)
|
||||||
|
{
|
||||||
|
// 执行更新操作
|
||||||
|
var updateCount = sqlSugarClient.Updateable<DouyinVideo>()
|
||||||
|
.SetColumns(it => new DouyinVideo
|
||||||
|
{
|
||||||
|
VideoSavePath = SqlFunc.Replace(it.VideoSavePath, "-poster.jpg", ".mp4")
|
||||||
|
})
|
||||||
|
.Where(it => it.IsMergeVideo == 1 && it.VideoSavePath.EndsWith("-poster.jpg"))
|
||||||
|
.ExecuteCommand();
|
||||||
|
if (updateCount > 0)
|
||||||
|
Serilog.Log.Debug($"更新了{updateCount}条图文视频存储路径,修复图文视频无法在页面播放的问题");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#region 测试创建数据库
|
#region 测试创建数据库
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
|
|||||||
+252
-504
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ namespace dy.net.utils
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (video.OnlyImgOrOnlyMp3) return;//图片,音频不刮削
|
||||||
string videoDirectory = Path.GetDirectoryName(video.VideoSavePath); // 视频所在目录
|
string videoDirectory = Path.GetDirectoryName(video.VideoSavePath); // 视频所在目录
|
||||||
string videoFileNameWithoutExt = Path.GetFileNameWithoutExtension(video.VideoSavePath); // 无扩展名的文件名
|
string videoFileNameWithoutExt = Path.GetFileNameWithoutExtension(video.VideoSavePath); // 无扩展名的文件名
|
||||||
var coverFileName = Path.GetFileName(video.VideoCoverSavePath);
|
var coverFileName = Path.GetFileName(video.VideoCoverSavePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user