feat: add fnOS packaging, storage workflows and release pipeline
This commit is contained in:
@@ -4,12 +4,13 @@ using dy.net.model.response;
|
||||
using dy.net.service;
|
||||
using dy.net.utils;
|
||||
using System.Threading.Tasks;
|
||||
using dy.net.storage;
|
||||
|
||||
namespace dy.net.job
|
||||
{
|
||||
public class DouyinCollectSyncJob : DouyinBasicSyncJob
|
||||
{
|
||||
public DouyinCollectSyncJob(DouyinCookieService douyinCookieService, DouyinHttpClientService douyinHttpClientService, DouyinVideoService douyinVideoService, DouyinCommonService douyinCommonService, DouyinFollowService douyinFollowService, DouyinMergeVideoService douyinMergeVideoService, DouyinCollectCateService douyinCollectCateService) : base(douyinCookieService, douyinHttpClientService, douyinVideoService, douyinCommonService, douyinFollowService, douyinMergeVideoService, douyinCollectCateService)
|
||||
public DouyinCollectSyncJob(DouyinCookieService douyinCookieService, DouyinHttpClientService douyinHttpClientService, DouyinVideoService douyinVideoService, DouyinCommonService douyinCommonService, DouyinFollowService douyinFollowService, DouyinMergeVideoService douyinMergeVideoService, DouyinCollectCateService douyinCollectCateService, MediaStorageRouter mediaStorageRouter, VideoTaskService videoTaskService) : base(douyinCookieService, douyinHttpClientService, douyinVideoService, douyinCommonService, douyinFollowService, douyinMergeVideoService, douyinCollectCateService, mediaStorageRouter, videoTaskService)
|
||||
{
|
||||
}
|
||||
protected override VideoTypeEnum VideoType => VideoTypeEnum.dy_collects;
|
||||
@@ -27,7 +28,7 @@ namespace dy.net.job
|
||||
|
||||
protected override string GetAuthorAvatarBasePath(DouyinCookie cookie)
|
||||
{
|
||||
return Path.Combine(cookie.SavePath, "author");
|
||||
return CombineStoragePath(GetStorageRoot(cookie, VideoType), "author");
|
||||
}
|
||||
|
||||
protected override async Task<DouyinVideoInfoResponse> FetchVideoData(DouyinCookie cookie, string cursor, DouyinFollowed followed, DouyinCollectCate cate)
|
||||
@@ -40,6 +41,8 @@ namespace dy.net.job
|
||||
|
||||
protected override string CreateSaveFolder(DouyinCookie cookie, Aweme item, AppConfig config, DouyinFollowed followed, DouyinCollectCate cate)
|
||||
{
|
||||
if (ActiveStorageType.IsRemote())
|
||||
return BuildRemotePathPlan(cookie, item, config, followed, cate).DirectoryPath;
|
||||
// 1. 简化获取博主自定义保存路径(合并空值判断)
|
||||
string saveFolder = !string.IsNullOrWhiteSpace(item?.Author?.Uid)
|
||||
? base.douyinCommonService.GetDouyinUpSavePath(item.Author.Uid)
|
||||
@@ -61,11 +64,12 @@ namespace dy.net.job
|
||||
string videoFolderName = DouyinFileNameHelper.SanitizeLinuxFileName(item?.Desc, item?.AwemeId, true);
|
||||
|
||||
// 4. 简化文件夹路径拼接+存在判断(核心逻辑不变)
|
||||
string folder = Path.Combine(cookie.SavePath, authorFolder, videoFolderName);
|
||||
var root = GetStorageRoot(cookie, VideoType);
|
||||
string folder = CombineStoragePath(root, authorFolder, videoFolderName);
|
||||
if (Directory.Exists(folder))
|
||||
{
|
||||
// 文件夹存在则拼接AwemeId(保留你的原逻辑)
|
||||
folder = Path.Combine(cookie.SavePath, authorFolder, $"{videoFolderName}_{item.AwemeId}");
|
||||
folder = CombineStoragePath(root, authorFolder, $"{videoFolderName}_{item.AwemeId}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -75,4 +79,4 @@ namespace dy.net.job
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user