feat: add fnOS packaging, storage workflows and release pipeline

This commit is contained in:
2026-08-11 18:05:49 +08:00
parent c5922f9b08
commit 95932f0199
181 changed files with 24024 additions and 1164 deletions
+15 -20
View File
@@ -3,12 +3,13 @@ using dy.net.model.entity;
using dy.net.model.response;
using dy.net.service;
using dy.net.utils;
using dy.net.storage;
namespace dy.net.job
{
public class DouyinMixSyncJob : DouyinBasicSyncJob
{
public DouyinMixSyncJob(DouyinCookieService douyinCookieService, DouyinHttpClientService douyinHttpClientService, DouyinVideoService douyinVideoService, DouyinCommonService douyinCommonService, DouyinFollowService douyinFollowService, DouyinMergeVideoService douyinMergeVideoService, DouyinCollectCateService douyinCollectCateService) : base(douyinCookieService, douyinHttpClientService, douyinVideoService, douyinCommonService, douyinFollowService, douyinMergeVideoService, douyinCollectCateService)
public DouyinMixSyncJob(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)
{
}
@@ -23,24 +24,22 @@ namespace dy.net.job
protected override Task<List<DouyinCookie>> GetSyncCookies()
{
return douyinCookieService.GetOpendCookiesAsync(x => !string.IsNullOrWhiteSpace(x.MixPath));
return GetCookiesWithPathAsync();
}
private async Task<List<DouyinCookie>> GetCookiesWithPathAsync()
{
var cookies = await douyinCookieService.GetOpendCookiesAsync();
return cookies.Where(x => !string.IsNullOrWhiteSpace(GetStorageRoot(x, VideoType))).ToList();
}
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;
if (cate != null)
{
if (string.IsNullOrWhiteSpace(cookie.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(cookie.MixPath, DouyinFileNameHelper.SanitizeLinuxFileName(cate.SaveFolder, cate.Name, true));
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
return folder;
}
var folder = CombineStoragePath(GetStorageRoot(cookie, VideoType), DouyinFileNameHelper.SanitizeLinuxFileName(cate.SaveFolder, cate.Name, true));
EnsureStorageDirectory(folder);
return folder;
}
else
{
@@ -50,11 +49,7 @@ namespace dy.net.job
protected override string GetAuthorAvatarBasePath(DouyinCookie cookie)
{
if (string.IsNullOrEmpty(cookie.MixPath))
return Path.Combine(cookie.SavePath, "author");
else
return Path.Combine(cookie.MixPath, "author");
return CombineStoragePath(GetStorageRoot(cookie, VideoType), "author");
}
}
}
}