关注博主列表同步bug修复

This commit is contained in:
jianzhichu
2026-01-22 21:38:42 +08:00
parent b331e73bd3
commit e011bd089f
26 changed files with 424 additions and 89 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ namespace dy.net.Controllers
public async Task<IActionResult> BatchSave(List<DouyinCollectCateSwitchDto> dto)
{
if(dto.Any(x=> !DouyinFileNameHelper.IsValidWithoutSpecialChars(x.Folder)))
if(dto.Any(x=> !DouyinFileNameHelper.IsValidWithoutSpecialChars(x.SaveFolder)))
{
return ApiResult.Fail("有部分文件名不符合要求,请检查");
}
+6 -1
View File
@@ -86,6 +86,11 @@ namespace dy.net.Controllers
var conf = dto.conf;
if (conf != null)
{
if (conf.BatchCount > 30)
{
Serilog.Log.Debug("$对不起,为了项目能长久稳定运行,还是最大不要超过30吧。。。");
conf.BatchCount = 30;
}
var update = await commonService.UpdateConfig(conf);
if (update)
Serilog.Log.Debug("系统配置导入成功");
@@ -257,7 +262,7 @@ namespace dy.net.Controllers
}
else
{
var result = await dyCookieService.UpdateAsync(dyUserCookies);
var result = await dyCookieService.UpdateCookieAsync(dyUserCookies);
if (result)
{
ReStartJob();
+1 -1
View File
@@ -220,7 +220,7 @@ namespace dy.net
//commonService.UpdateAllCookieSyncedToZero();
// 初始化配置
var config = commonService.InitConfig();
if (!isDevelopment)
//if (!isDevelopment)
{
// 启动定时任务
var quartzJobService = services.GetRequiredService<DouyinQuartzJobService>();
+1 -1
View File
@@ -17,6 +17,6 @@
<SelfContained>false</SelfContained>
<!--<DockerArch>x86</DockerArch>-->
<!--<DockerArch>arm</DockerArch> -->
<!--<DockerCoreVersion>2.0.1</DockerCoreVersion>-->
<!--<DockerCoreVersion>2.0.2</DockerCoreVersion>-->
</PropertyGroup>
</Project>
@@ -3,7 +3,7 @@
<Project>
<PropertyGroup>
<_PublishTargetUrl>E:\code\dysync\bin\Release\net6.0\publish\</_PublishTargetUrl>
<History>True|2026-01-22T04:44:28.1577014Z||;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||;True|2026-01-22T01:34:14.2142463+08:00||;True|2026-01-22T01:32:50.9228911+08:00||;True|2026-01-22T01:29:43.8871986+08:00||;True|2026-01-22T01:29:40.7838709+08:00||;True|2026-01-22T01:27:34.4763970+08:00||;True|2026-01-22T01:26:55.0117367+08:00||;True|2026-01-22T01:23:19.4789587+08:00||;True|2026-01-19T10:19:44.8997385+08:00||;True|2026-01-19T10:11:10.2305307+08:00||;True|2026-01-17T00:52:08.8180346+08:00||;False|2026-01-17T00:52:03.1829000+08:00||;True|2026-01-17T00:45:04.0498090+08:00||;True|2026-01-16T21:00:57.7239379+08:00||;True|2026-01-16T21:00:03.3912989+08:00||;True|2026-01-16T20:56:08.5505592+08:00||;True|2026-01-16T20:46:32.3067302+08:00||;True|2026-01-15T22:18:57.9835738+08:00||;True|2026-01-15T22:07:25.4753938+08:00||;True|2026-01-15T22:07:14.8243754+08:00||;True|2026-01-15T21:40:13.2613927+08:00||;True|2026-01-15T20:57:56.6291682+08:00||;True|2026-01-15T20:57:47.1363536+08:00||;True|2026-01-15T20:08:44.4710883+08:00||;True|2026-01-15T20:04:51.8284314+08:00||;False|2026-01-15T20:04:45.3258155+08:00||;True|2026-01-15T19:59:11.7907672+08:00||;True|2026-01-15T01:10:48.9066941+08:00||;True|2026-01-15T01:03:23.6216975+08:00||;True|2026-01-15T01:03:16.3364591+08:00||;False|2026-01-15T01:03:10.5654436+08:00||;True|2026-01-15T00:49:21.6559622+08:00||;True|2026-01-15T00:10:42.7288439+08:00||;True|2026-01-15T00:06:28.4241682+08:00||;True|2026-01-13T22:34:15.2372411+08:00||;True|2026-01-13T22:26:46.4522947+08:00||;True|2026-01-13T22:15:56.9735179+08:00||;True|2026-01-13T22:15:51.8250677+08:00||;False|2026-01-13T22:15:46.6608690+08:00||;True|2026-01-13T22:03:06.4683237+08:00||;False|2026-01-13T22:03:01.2036027+08:00||;True|2026-01-13T21:36:05.8776209+08:00||;True|2026-01-13T21:33:02.0766289+08:00||;False|2026-01-13T21:32:57.1976141+08:00||;True|2026-01-13T19:14:35.2519439+08:00||;True|2026-01-13T15:07:50.0836745+08:00||;False|2026-01-13T15:06:35.5929685+08:00||;True|2026-01-13T10:21:41.6012776+08:00||;True|2026-01-13T09:57:25.4788847+08:00||;True|2026-01-13T09:53:14.4900360+08:00||;True|2026-01-13T09:23:53.6465295+08:00||;True|2026-01-12T22:04:14.5886955+08:00||;False|2026-01-12T22:04:08.2008101+08:00||;True|2026-01-12T21:53:46.9947176+08:00||;True|2026-01-12T21:11:15.8358024+08:00||;True|2026-01-12T21:09:51.8663228+08:00||;True|2026-01-11T21:25:07.5052845+08:00||;False|2026-01-11T21:24:27.5744557+08:00||;True|2026-01-11T19:59:15.4734611+08:00||;False|2026-01-11T19:59:04.9543339+08:00||;True|2026-01-11T18:51:30.6649269+08:00||;True|2026-01-08T21:07:57.5094466+08:00||;True|2026-01-08T14:51:18.2266231+08:00||;True|2026-01-08T14:31:55.1137120+08:00||;True|2026-01-08T00:16:24.4451490+08:00||;True|2026-01-08T00:14:20.7430793+08:00||;True|2026-01-08T00:07:46.7228194+08:00||;True|2026-01-07T23:52:13.3290082+08:00||;True|2026-01-07T23:49:28.4838650+08:00||;True|2026-01-07T23:47:45.1936189+08:00||;True|2026-01-07T23:35:09.7818611+08:00||;True|2026-01-07T23:20:43.7462863+08:00||;True|2026-01-07T23:04:39.5140429+08:00||;False|2026-01-07T23:04:36.5367611+08:00||;True|2026-01-07T22:53:14.6013449+08:00||;True|2026-01-07T22:49:59.9549006+08:00||;True|2026-01-07T22:36:40.0254856+08:00||;False|2026-01-07T22:36:28.8275903+08:00||;True|2026-01-07T21:59:51.4355171+08:00||;True|2026-01-03T21:38:51.4307034+08:00||;True|2026-01-02T19:09:16.9668906+08:00||;False|2026-01-02T19:09:11.7496369+08:00||;True|2026-01-02T15:42:08.2215697+08:00||;True|2026-01-02T09:46:56.1654861+08:00||;True|2026-01-02T09:35:28.0211225+08:00||;True|2026-01-01T23:07:01.9022045+08:00||;False|2026-01-01T23:06:56.0537216+08:00||;True|2026-01-01T22:16:10.2974067+08:00||;True|2026-01-01T22:16:06.2123787+08:00||;False|2026-01-01T22:15:33.3626979+08:00||;True|2026-01-01T22:01:30.7161900+08:00||;True|2026-01-01T21:10:19.3664263+08:00||;True|2026-01-01T21:09:38.6071080+08:00||;True|2025-12-30T11:45:54.5543034+08:00||;True|2025-12-30T09:19:08.3178124+08:00||;True|2025-12-29T18:57:29.7032246+08:00||;</History>
<History>True|2026-01-22T13:32:21.7284081Z||;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||;True|2026-01-22T01:34:14.2142463+08:00||;True|2026-01-22T01:32:50.9228911+08:00||;True|2026-01-22T01:29:43.8871986+08:00||;True|2026-01-22T01:29:40.7838709+08:00||;True|2026-01-22T01:27:34.4763970+08:00||;True|2026-01-22T01:26:55.0117367+08:00||;True|2026-01-22T01:23:19.4789587+08:00||;True|2026-01-19T10:19:44.8997385+08:00||;True|2026-01-19T10:11:10.2305307+08:00||;True|2026-01-17T00:52:08.8180346+08:00||;False|2026-01-17T00:52:03.1829000+08:00||;True|2026-01-17T00:45:04.0498090+08:00||;True|2026-01-16T21:00:57.7239379+08:00||;True|2026-01-16T21:00:03.3912989+08:00||;True|2026-01-16T20:56:08.5505592+08:00||;True|2026-01-16T20:46:32.3067302+08:00||;True|2026-01-15T22:18:57.9835738+08:00||;True|2026-01-15T22:07:25.4753938+08:00||;True|2026-01-15T22:07:14.8243754+08:00||;True|2026-01-15T21:40:13.2613927+08:00||;True|2026-01-15T20:57:56.6291682+08:00||;True|2026-01-15T20:57:47.1363536+08:00||;True|2026-01-15T20:08:44.4710883+08:00||;True|2026-01-15T20:04:51.8284314+08:00||;False|2026-01-15T20:04:45.3258155+08:00||;True|2026-01-15T19:59:11.7907672+08:00||;True|2026-01-15T01:10:48.9066941+08:00||;True|2026-01-15T01:03:23.6216975+08:00||;True|2026-01-15T01:03:16.3364591+08:00||;False|2026-01-15T01:03:10.5654436+08:00||;True|2026-01-15T00:49:21.6559622+08:00||;True|2026-01-15T00:10:42.7288439+08:00||;True|2026-01-15T00:06:28.4241682+08:00||;True|2026-01-13T22:34:15.2372411+08:00||;True|2026-01-13T22:26:46.4522947+08:00||;True|2026-01-13T22:15:56.9735179+08:00||;True|2026-01-13T22:15:51.8250677+08:00||;False|2026-01-13T22:15:46.6608690+08:00||;True|2026-01-13T22:03:06.4683237+08:00||;False|2026-01-13T22:03:01.2036027+08:00||;True|2026-01-13T21:36:05.8776209+08:00||;True|2026-01-13T21:33:02.0766289+08:00||;False|2026-01-13T21:32:57.1976141+08:00||;True|2026-01-13T19:14:35.2519439+08:00||;True|2026-01-13T15:07:50.0836745+08:00||;False|2026-01-13T15:06:35.5929685+08:00||;True|2026-01-13T10:21:41.6012776+08:00||;True|2026-01-13T09:57:25.4788847+08:00||;True|2026-01-13T09:53:14.4900360+08:00||;True|2026-01-13T09:23:53.6465295+08:00||;True|2026-01-12T22:04:14.5886955+08:00||;False|2026-01-12T22:04:08.2008101+08:00||;True|2026-01-12T21:53:46.9947176+08:00||;True|2026-01-12T21:11:15.8358024+08:00||;True|2026-01-12T21:09:51.8663228+08:00||;True|2026-01-11T21:25:07.5052845+08:00||;False|2026-01-11T21:24:27.5744557+08:00||;True|2026-01-11T19:59:15.4734611+08:00||;False|2026-01-11T19:59:04.9543339+08:00||;True|2026-01-11T18:51:30.6649269+08:00||;True|2026-01-08T21:07:57.5094466+08:00||;True|2026-01-08T14:51:18.2266231+08:00||;True|2026-01-08T14:31:55.1137120+08:00||;True|2026-01-08T00:16:24.4451490+08:00||;True|2026-01-08T00:14:20.7430793+08:00||;True|2026-01-08T00:07:46.7228194+08:00||;True|2026-01-07T23:52:13.3290082+08:00||;True|2026-01-07T23:49:28.4838650+08:00||;True|2026-01-07T23:47:45.1936189+08:00||;True|2026-01-07T23:35:09.7818611+08:00||;True|2026-01-07T23:20:43.7462863+08:00||;True|2026-01-07T23:04:39.5140429+08:00||;False|2026-01-07T23:04:36.5367611+08:00||;True|2026-01-07T22:53:14.6013449+08:00||;True|2026-01-07T22:49:59.9549006+08:00||;True|2026-01-07T22:36:40.0254856+08:00||;False|2026-01-07T22:36:28.8275903+08:00||;True|2026-01-07T21:59:51.4355171+08:00||;True|2026-01-03T21:38:51.4307034+08:00||;True|2026-01-02T19:09:16.9668906+08:00||;False|2026-01-02T19:09:11.7496369+08:00||;True|2026-01-02T15:42:08.2215697+08:00||;True|2026-01-02T09:46:56.1654861+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
+3 -3
View File
@@ -93,8 +93,8 @@ Cookie 及 `sec_user_id` 是同步功能的核心,需严格按步骤获取,
| 镜像标签 | 架构 |
| ----------------- | -------------- |
| `beta_2.0.1` | x86_64 (amd64) |
| `arm_2.0.1` | ARM64 |
| `beta_2.0.2` | x86_64 (amd64) |
| `arm_2.0.2` | ARM64 |
### 构建命令示例
@@ -113,7 +113,7 @@ version: '3.8'
services:
dysync:
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.0.1
image: ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_2.0.2
container_name: dysync2026 # 容器名称
restart: unless-stopped # 始终重启容器,除非容器被手动停止或Docker服务停止
ports:
+102 -22
View File
@@ -59,8 +59,8 @@ type DataItem = {
useCollectFolder?: boolean;
downMix?: boolean;
downSeries?: boolean;
// mixPath?: string;
// seriesPath?: string;
mixPath?: string;
seriesPath?: string;
};
const loading = ref(false);
@@ -124,8 +124,8 @@ const newCookie = (cookie?: DataItem) => {
cookie.useCollectFolder = false; //是否按收藏夹来下载。
cookie.downMix = false; //是否下载收藏夹的合集
cookie.downSeries = false; //是否下载短剧
// cookie.mixPath = undefined; //合集存储路径
// cookie.seriesPath = undefined; //短剧存储路径
cookie.mixPath = undefined; //合集存储路径
cookie.seriesPath = undefined; //短剧存储路径
return cookie;
};
@@ -526,17 +526,30 @@ const saveDrawerData = () => {
</div>
</a-form-item>
<!-- 新增是否全部用一个地址开关 -->
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="是否统一存储路径" name="useSinglePath">
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="统一存储路径" name="useSinglePath">
<div style="display: flex; align-items: center; gap: 12px;">
<div class="form-item-div">
<a-switch v-model:checked="form.useSinglePath" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{form.useSinglePath ?'':''}}</span>
<span style="margin-left:10px;">{{form.useSinglePath ?'':''}}</span>
</div>
<a-alert message="开启后,所有视频都存储在收藏视频存储的路径,如果是容器部署:docker-compose配置,此时只需要映射一个路径' " :type="form.useSinglePath?'success':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
<a-alert message="开启后,喜欢、关注、收藏都存储在一个目录,如果是容器部署:docker-compose配置,只需要映射一个路径 (合集短剧存储路径需要另外设置映射)" :type="form.useSinglePath?'error':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="下载自定义收藏夹" name="useCollectFolder">
<div style="display: flex; align-items: center; gap: 12px;">
<div class="form-item-div">
<a-switch v-model:checked="form.useCollectFolder" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{ form.useCollectFolder ? '' : '' }}</span>
<span>存储路径=收藏的存储路径</span>
<a-button @click="openCollectFolderSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.useCollectFolder">
<tag-outlined />
</a-button>
</div>
<a-alert message="开启后按照自定义收藏进行下载(需要开启收藏文件夹同步开关)且不再下载默认收藏夹视频" :type="form.useCollectFolder?'error':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
<!-- 喜欢的存储路径 -->
<a-form-item label="喜欢的存储路径" name="favSavePath">
<div style="display: flex; align-items: center; gap: 12px; width: 100%;">
@@ -552,33 +565,57 @@ const saveDrawerData = () => {
<a-alert message="不想同步关注列表博主的视频就空着" type="info" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="下载收藏夹" name="useCollectFolder">
<!-- 下载合集 - 新增name="mixPath" -->
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="下载合集" name="downMix">
<div style="display: flex; align-items: center; gap: 12px;">
<div class="form-item-div">
<a-switch v-model:checked="form.useCollectFolder" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{ form.useCollectFolder ? '' : '' }}</span>
<a-switch v-model:checked="form.downMix" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{ form.downMix ? '' : '' }}</span>
<!-- 给输入框对应的form-item添加name属性 -->
<a-form-item name="mixPath" noStyle>
<a-input v-model:value="form.mixPath" class="form-item-div-input" />
</a-form-item>
<a-button @click="openCollectFolderSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.useCollectFolder">
<setting-outlined />
<a-button @click="openMixDownSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.downMix"> <tag-outlined />
</a-button>
</div>
<a-alert message="开启后按照设置的自定义收藏文件夹进行下载(需要开启收藏文件夹同步开关)" :type="form.useCollectFolder?'success':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
<a-alert message="开启后会同步下载收藏的合集(需要开启合集同步开关,不设置路径默认存储到收藏,设置后记得docker里面加映射)," :type="form.downMix?'error':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
<!-- 下载短剧 - 新增name="seriesPath" -->
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="下载短剧" name="downSeries">
<div style="display: flex; align-items: center; gap: 12px;">
<div class="form-item-div">
<a-switch v-model:checked="form.downSeries" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{ form.downSeries ? '' : '' }}</span>
<!-- 给输入框对应的form-item添加name属性 -->
<a-form-item name="seriesPath" noStyle>
<a-input v-model:value="form.seriesPath" class="form-item-div-input" />
</a-form-item>
<a-button @click="openSeriesDownSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.downSeries"> <tag-outlined />
</a-button>
</div>
<a-alert message="开启后会同步下载收藏的短剧(需要开启短剧同步开关,不设置路径默认存储到收藏,设置后记得docker里面加映射)" :type="form.downSeries?'error':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
<!--
<a-form-item v-if="form.savePath&&form.savePath.length>0" label="下载合集" name="downMix">
<div style="display: flex; align-items: center; gap: 12px;">
<div class="form-item-div">
<a-switch v-model:checked="form.downMix" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{ form.downMix ? '是' : '否' }}</span>
<!-- <a-input v-model:value="form.mixPath" class="form-item-div-input" /> -->
<a-input v-model:value="form.mixPath" class="form-item-div-input" />
<a-button @click="openMixDownSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.downMix"> <setting-outlined />
<a-button @click="openMixDownSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.downMix"> <tag-outlined />
</a-button>
</div>
<a-alert message="开启后会同步下载收藏的合集(需要开启合集同步开关" :type="form.downMix?'success':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
<a-alert message="开启后会同步下载收藏的合集(需要开启合集同步开关,不设置路径默认存储到收藏,设置后记得docker里面加映射)," :type="form.downMix?'error':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
@@ -587,15 +624,15 @@ const saveDrawerData = () => {
<div class="form-item-div">
<a-switch v-model:checked="form.downSeries" :checked-value="true" :un-checked-value="false" size="default" />
<span style="margin-left:10px;">{{ form.downSeries ? '是' : '否' }}</span>
<!-- <a-input v-model:value="form.seriesPath" class="form-item-div-input" /> -->
<a-input v-model:value="form.seriesPath" class="form-item-div-input" />
<a-button @click="openSeriesDownSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.downSeries"> <setting-outlined />
<a-button @click="openSeriesDownSetModal" shape="circle" type="dashed" style="margin-left:10px;" v-if="form.downSeries"> <tag-outlined />
</a-button>
</div>
<a-alert message="开启后会同步下载收藏的短剧(需要开启短剧同步开关)" :type="form.downSeries?'success':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
<a-alert message="开启后会同步下载收藏的短剧(需要开启短剧同步开关,不设置路径默认存储到收藏,设置后记得docker里面加映射" :type="form.downSeries?'error':'info'" size="small" style="flex: 1; margin-bottom: 0;" />
</div>
</a-form-item>
</a-form-item> -->
<!-- 图文的存储路径 -->
<!-- <a-form-item label="图文的存储路径" name="imgSavePath">
@@ -609,7 +646,7 @@ const saveDrawerData = () => {
<a-form-item label="同步状态" name="status">
<div style="display: flex; align-items: center; gap: 8px;">
<a-switch v-model:checked="form.status" :checked-value="1" :un-checked-value="0" size="default" />
<span>{{ form.status === 1 ? '开启' : '停止' }}</span>
<span>{{ form.status === 1 ? '' : '' }}</span>
</div>
</a-form-item>
</a-form>
@@ -830,7 +867,6 @@ const saveDrawerData = () => {
flex: 1;
margin-bottom: 0 !important;
}
// ========== 精准匹配模板:a-card-grid 样式优化 ==========
/* 父容器:解决卡片间隙,避免换行(不改动模板,仅样式控制) */
.drawer-card-container.grid-container {
@@ -844,12 +880,29 @@ const saveDrawerData = () => {
flex-wrap: wrap;
gap: 20px; /* 卡片之间的横向/纵向间隙(可自定义,不会换行) */
box-sizing: border-box;
/* 固定左对齐:单元素/多元素都保持从左往右排列 */
justify-content: flex-start;
/* 新增:兜底最小高度,避免空容器塌陷 */
min-height: 200px;
/* 新增:左内边距,让单元素和多元素视觉对齐一致 */
padding-left: 5px;
}
/* 新增:单元素样式修复 - 关键修复(仅防变形,不居中) */
.drawer-card-container.grid-container:has(:only-child) :deep(.drawer-card-grid) {
/* 单元素时保持3列布局的宽度,不拉伸,防止变形 */
width: calc(33.333% - 10.333px) !important;
/* 可选:如果觉得单元素太窄,可取消下面注释,设置固定宽度 */
/* width: 300px !important; */
min-width: 200px; /* 强制最小宽度,防止压缩变形 */
}
/* a-card-grid 核心样式:圆角 + 固定宽度 + 内边距 */
:deep(.drawer-card-grid) {
// 精确宽度计算:3列均分,减去 gap 分摊值,避免换行
width: calc(33.333% - 10.333px) !important; /* 20px gap 分摊到3列,每列减 ~13.333px */
/* 新增:最小宽度限制,防止变形(核心) */
min-width: 200px;
margin: 5px !important; /* 清除组件自带 margin,避免间隙重复 */
border-radius: 12px !important; /* 卡片圆角(可自定义大小) */
padding: 16px !important; /* 卡片内部整体内边距 */
@@ -922,13 +975,30 @@ const saveDrawerData = () => {
@media (max-width: 768px) {
:deep(.drawer-card-grid) {
width: calc(50% - 10px) !important; /* 2列均分,20px gap 每列减10px */
/* 新增:响应式最小宽度 */
min-width: 180px;
}
/* 响应式下单元素适配(保持左对齐) */
.drawer-card-container.grid-container:has(:only-child) :deep(.drawer-card-grid) {
width: calc(50% - 10px) !important;
min-width: 180px;
}
}
@media (max-width: 480px) {
:deep(.drawer-card-grid) {
width: 100% !important; /* 1列铺满,无间距分摊 */
/* 新增:移动端最小宽度铺满 */
min-width: 100%;
}
/* 移动端单元素适配(1列铺满) */
.drawer-card-container.grid-container:has(:only-child) :deep(.drawer-card-grid) {
width: 100% !important;
min-width: 100%;
}
}
// ========== 黑暗模式样式(html.dark-mode + 链式类名,光效增强 + hover 效果) ==========
/* 卡片:深色背景 + 隐式边框 + 增强光效(默认状态) */
html.dark-mode .drawer-card-container.grid-container .drawer-card-grid {
@@ -1024,6 +1094,16 @@ html.dark-mode .drawer-card-container.grid-container .drawer-card-grid .ant-inpu
color: #228b22;
}
/* 还原 Alert 各类型的官方默认颜色 */
/* 错误(error)类型 - 红色系 */
.ant-alert-error {
background-color: #fff1f0; /* 错误类型背景色 */
border: 1px solid #ff4d4f; /* 错误类型边框色 */
}
.ant-alert-error .ant-alert-message {
color: #f5222d; /* 错误类型文字主色 */
}
.ant-alert-warning {
background-color: #fffbe6;
border: 1px solid #ffe58f;
+1 -1
View File
@@ -25,7 +25,7 @@
<a-switch v-model:checked="formState.OnlySyncNew" />
<div class="flex items-start mt-1 text-sm text-gray-500">
<InfoCircleOutlined class="text-blue-400 mr-1 mt-0.5" />
<span>开启后仅同步最近的20条以及未来新加入收藏喜欢关注的视频不会去同步之前的视频默认开启 避免突然大量下载导致风控</span>
<span>开启后仅同步最近的一页数据仅对默认收藏夹和点赞视频有效避免突然大量下载导致风控</span>
</div>
</a-form-item>
</div>
+3
View File
@@ -30,6 +30,9 @@
<a-radio-button value="2">收藏的</a-radio-button>
<a-radio-button value="3">关注的</a-radio-button>
<a-radio-button value="4" v-if="showImageViedo">图文视频</a-radio-button>
<a-radio-button value="5">收藏夹</a-radio-button>
<a-radio-button value="6">合集</a-radio-button>
<a-radio-button value="7">短剧</a-radio-button>
</a-radio-group>
</a-form-item>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -129,7 +129,7 @@
</ItemGroup>
</Target>
<!-- 核心配置:仅用核心版本号2.0.1,自动拼接前缀 -->
<!-- 核心配置:仅用核心版本号2.0.2,自动拼接前缀 -->
<!--<Target Name="DockerBuildAndPushAfterPublish" AfterTargets="Publish">
<Exec Command="docker build -t jianzhichu/dysync.net:beta_$(DockerCoreVersion) . &amp;&amp; docker tag jianzhichu/dysync.net:beta_$(DockerCoreVersion) ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion) &amp;&amp; docker push ccr.ccs.tencentyun.com/jianzhichu/dysync:beta_$(DockerCoreVersion)"
Condition="'$(DockerArch)' == 'x86'" />
+5 -5
View File
@@ -24,10 +24,10 @@ namespace dy.net.job
// 常量定义
private const string DEFAULT_FOLLOW_COUNT = "20";
private const int INVALID_COOKIE_STATUS_CODE = 8;
private const string LOG_TAG_COLLECT = "收藏夹同步";
private const string LOG_TAG_MIX = "合集列表同步";
private const string LOG_TAG_SERIES = "短剧列表同步";
private const string LOG_TAG_FOLLOW = "关注列表同步";
private const string LOG_TAG_COLLECT = "收藏列表";
private const string LOG_TAG_MIX = "合集列表";
private const string LOG_TAG_SERIES = "短剧列表";
private const string LOG_TAG_FOLLOW = "关注列表";
// 构造函数注入
public DouyinFollowsAndCollnectsSyncJob(
@@ -123,7 +123,6 @@ namespace dy.net.job
Log.Debug($"完成[{ck.UserName}] [列表]同步, 包括 [自定义收藏夹、关注、合集、短剧] ");
}
await _douyinCommonService.SetConfigNotFirstRunning();
}
#region
@@ -251,6 +250,7 @@ namespace dy.net.job
var (add, update, succ) = await _followService.Sync(followList, cookie);
Log.Information($"[{cookie.UserName}] - {LOG_TAG_FOLLOW}:同步完成 新增:{add} 更新:{update} 成功:{succ} 总关注数:{total}");
}
await _douyinCommonService.SetConfigNotFirstRunning();
}
catch (Exception ex)
{
+9
View File
@@ -28,12 +28,21 @@ namespace dy.net.job
protected override string CreateSaveFolder(DouyinCookie cookie, Aweme item, AppConfig config, DouyinFollowed followed, DouyinCollectCate cate)
{
if (cate != null)
{
if(string.IsNullOrWhiteSpace(config.MixPath))
{
var folder = Path.Combine(cookie.SavePath, VideoType.GetDesc(), DouyinFileNameHelper.SanitizeLinuxFileName(cate.SaveFolder, cate.Name, true));
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
return folder;
}
else
{
var folder = Path.Combine(config.MixPath, DouyinFileNameHelper.SanitizeLinuxFileName(cate.SaveFolder, cate.Name, true));
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
return folder;
}
}
else
{
return base.CreateSaveFolder(cookie, item, config, followed, cate);
}
+9
View File
@@ -29,12 +29,21 @@ namespace dy.net.job
protected override string CreateSaveFolder(DouyinCookie cookie, Aweme item, AppConfig config, DouyinFollowed followed, DouyinCollectCate cate)
{
if (cate != null)
{
if (string.IsNullOrWhiteSpace(config.SeriesPath))
{
var folder = Path.Combine(cookie.SavePath, VideoType.GetDesc(), DouyinFileNameHelper.SanitizeLinuxFileName(cate.SaveFolder, cate.Name, true));
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
return folder;
}
else
{
var folder = Path.Combine(config.SeriesPath, DouyinFileNameHelper.SanitizeLinuxFileName(cate.SaveFolder, cate.Name, true));
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
return folder;
}
}
else
{
return base.CreateSaveFolder(cookie, item, config, followed, cate);
}
+1 -1
View File
@@ -13,6 +13,6 @@
public bool Sync { get; set; }
public string Folder { get; set; }
public string SaveFolder { get; set; }
}
}
+7 -7
View File
@@ -7,38 +7,38 @@ namespace dy.net.model.dto
/// <summary>
///喜欢的
/// </summary>
[Description("喜欢的")]
//[Description("喜欢的")]
dy_favorite = 1,
/// <summary>
///收藏的
/// </summary>
[Description("收藏的")]
//[Description("收藏的")]
dy_collects = 2,
/// <summary>
/// 关注的
/// </summary>
[Description("关注的")]
//[Description("关注的")]
dy_follows = 3,
/// <summary>
/// 图文视频,无用了,但是不能删...
/// </summary>
[Description("图片视频")]
//[Description("图片视频")]
ImageVideo = 4,
/// <summary>
/// 自定义收藏夹
/// </summary>
[Description("收藏短剧")]
//[Description("收藏短剧")]
dy_custom_collect = 5,
/// <summary>
/// 收藏合集
/// </summary>
[Description("收藏合集")]
//[Description("收藏合集")]
dy_mix = 6,
/// <summary>
/// 收藏短剧
/// </summary>
[Description("收藏短剧")]
//[Description("收藏短剧")]
dy_series = 7,
}
+11
View File
@@ -100,6 +100,17 @@ namespace dy.net.model.entity
/// 保留原动态视频文件
/// </summary>
public bool KeepDynamicVideo { get; set; }
/// <summary>
/// 合集路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string MixPath { get; set; }
/// <summary>
/// 短剧路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string SeriesPath { get; set; }
}
}
+18 -13
View File
@@ -75,9 +75,14 @@ namespace dy.net.model.entity
/// 如果是0,则同步时会获取全部数据;如果是1,则同步时只获取最新的数据(也就是只查一次)
/// 接口可以将该值改为0,下次开始同步就会重新获取全部数据
/// </summary>
//public int CollHasSyncd { get; set; }
//public int FavHasSyncd { get; set; }
//public int UperSyncd { get; set; }
[SugarColumn(IsNullable = true)]
public int CollHasSyncd { get; set; }
[SugarColumn(IsNullable = true)]
public int FavHasSyncd { get; set; }
[SugarColumn(IsNullable = true)]
public int UperSyncd { get; set; }
/// <summary>
/// 关注的用户sec_user_id列表 json字符串存储
/// </summary>
@@ -116,16 +121,16 @@ namespace dy.net.model.entity
[SugarColumn(Length = 100, IsNullable = true, ColumnName = "useSinglePath")]
public bool UseSinglePath { get; set; } = true;//默认true
///// <summary>
///// 合集存储路径
///// </summary>
//[SugarColumn(Length = 500, IsNullable = true)]
//public string MixPath { get; set; }
/// <summary>
/// 合集存储路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string MixPath { get; set; }
///// <summary>
///// 短剧存储路径
///// </summary>
//[SugarColumn(Length = 500, IsNullable = true)]
//public string SeriesPath { get; set; }
/// <summary>
/// 短剧存储路径
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string SeriesPath { get; set; }
}
}
+2 -1
View File
@@ -1,5 +1,6 @@
using dy.net.extension;
using dy.net.model.dto;
using dy.net.utils;
using SqlSugar;
namespace dy.net.model.entity
@@ -145,7 +146,7 @@ namespace dy.net.model.entity
public int IsMergeVideo { get; set; }
[SugarColumn(IsIgnore = true)]
public string ViedoTypeStr => ViedoType.GetDescription();
public string ViedoTypeStr => ViedoType.GetDesc();
[SugarColumn(IsIgnore = true)]
public string ViedoCate =>(string.IsNullOrWhiteSpace(Tag1) ? "" : Tag1) + "/" + (string.IsNullOrWhiteSpace(Tag2) ? "" : Tag2);
+1 -1
View File
@@ -55,7 +55,7 @@ namespace dy.net.repository
if (dtoDict.TryGetValue(item.Id, out var dtocate))
{
item.Sync = dtocate.Sync;
item.SaveFolder = string.IsNullOrWhiteSpace(dtocate.Folder) ? DouyinFileNameHelper.SanitizeLinuxFileName(item.Name, item.Id, true) : dtocate.Folder;
item.SaveFolder = string.IsNullOrWhiteSpace(dtocate.SaveFolder) ? DouyinFileNameHelper.SanitizeLinuxFileName(item.Name, item.Id, true) : dtocate.SaveFolder;
item.UpdateTime = DateTime.Now;
}
});
+11
View File
@@ -51,5 +51,16 @@ namespace dy.net.repository
return res > 0;
}
public async Task<bool> UpdateCookie(DouyinCookie cookie)
{
if (cookie != null)
{
var res = await Db.Updateable<DouyinCookie>(cookie).IgnoreColumns(x => new { x.MyUserId }).ExecuteCommandAsync();
return res > 0;
}
return false;
}
}
}
+1 -1
View File
@@ -208,7 +208,7 @@ namespace dy.net.repository
// 6. 提交事务
await Db.Ado.CommitTranAsync();
// 【重要】删除逻辑已移除:增量场景下不能通过批次对比删除,需单独设计取消关注逻辑
Serilog.Log.Debug($"dy_followed_users{ck.UserName}关注列表同步完成:新增{toAddFollows.Count}条,更新{toUpdateFollows.Count}条");
Serilog.Log.Debug($"[{ck.UserName}]关注列表同步完成:新增{toAddFollows.Count}条,更新{toUpdateFollows.Count}条");
return (toAddFollows.Count, toUpdateFollows.Count, true);
}
catch (Exception ex)
+6
View File
@@ -87,6 +87,12 @@ namespace dy.net.service
return await _cookieRepository.UpdateAsync(dyUserCookies);
}
// 更新
public async Task<bool> UpdateCookieAsync(DouyinCookie dyUserCookies)
{
return await _cookieRepository.UpdateCookie(dyUserCookies);
}
// 删除(根据主键)
public async Task<bool> DeleteByIdAsync(string id)
{
+5 -18
View File
@@ -49,7 +49,7 @@ namespace dy.net.service
"抖音关注博主作品同步任务")
},
{
"follow_user",
"关注列表",
new JobConfig(
typeof(DouyinFollowsAndCollnectsSyncJob),
"dy.job.key.follow_user",
@@ -101,7 +101,7 @@ namespace dy.net.service
/// <param name="expression">Cron表达式或间隔分钟数(所有任务使用相同的执行频率)</param>
/// <param name="isRestart"></param>
/// <returns>是否启动成功</returns>
public async Task<bool> InitOrReStartAllJobs(string expression,bool isRestart=false)
public async Task<bool> InitOrReStartAllJobs(string expression)
{
if (string.IsNullOrWhiteSpace(expression))
{
@@ -116,14 +116,9 @@ namespace dy.net.service
// 移除所有已存在的任务(避免重复调度)
await RemoveAllExistingJobs(scheduler);
// 遍历启动所有任务(独立执行,无顺序依赖)
// 统一生成任务列表
var jobKeys = isRestart
? JobConfigs.Keys.Where(k => k != "follow_user_once").ToList()
: JobConfigs.Keys.Where(k => k != "follow_user_once" && k != "follow_user").ToList();
// 执行任务启动逻辑
foreach (var jobKey in jobKeys)
foreach (var jobKey in JobConfigs.Keys)
{
if (jobKey == "follow_user") expression = "60";
var startSuccess = await StartJobAsync(jobKey, expression);
@@ -136,19 +131,11 @@ namespace dy.net.service
Log.Error($"启动任务失败:{jobKey}");
}
}
// 补充日志和单次任务
if (isRestart)
{
Log.Information($"共启动 {jobKeys.Count} 个定时任务");
}
else
{
await StartOneTimeJobAsync("follow_user_once");
}
Log.Information($"共启动 {JobConfigs.Count} 个定时任务");
//await StartJobAsync(VideoTypeEnum.dy_custom_collect.GetDesc(), expression);
//await StartFollowJobOnceAsync();
return true;
}
catch (Exception ex)
+3 -3
View File
@@ -391,10 +391,10 @@ namespace dy.net.service
Date = g.Key,
Collect = g.Count(x => x.ViedoType == VideoTypeEnum.dy_collects || x.ViedoType == VideoTypeEnum.dy_custom_collect),
Favorite = g.Count(x => x.ViedoType == VideoTypeEnum.dy_favorite),
Follow = g.Count(x => x.ViedoType != VideoTypeEnum.dy_follows),
Follow = g.Count(x => x.ViedoType == VideoTypeEnum.dy_follows),
Graphic = g.Count(x => string.IsNullOrEmpty(x.FileHash)),
Mix = g.Count(x => x.ViedoType != VideoTypeEnum.dy_mix),
Series = g.Count(x => x.ViedoType != VideoTypeEnum.dy_series),
Mix = g.Count(x => x.ViedoType == VideoTypeEnum.dy_mix),
Series = g.Count(x => x.ViedoType == VideoTypeEnum.dy_series),
})
.ToList();
return resultData;