mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 16:18:59 +08:00
chore: 增加上传同步配置的详细日志
This commit is contained in:
parent
6ec8c29f6a
commit
a1b86e26a2
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.257",
|
||||
"version": "2.14.258",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -128,10 +128,19 @@ async function doSync() {
|
||||
files.map((item) => [item.path, item]),
|
||||
);
|
||||
}
|
||||
const url = files[encodeURIComponent(artifact.name)]?.raw_url;
|
||||
artifact.url = isGitLab
|
||||
? url
|
||||
: url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
|
||||
const raw_url =
|
||||
files[encodeURIComponent(artifact.name)]?.raw_url;
|
||||
const new_url = isGitLab
|
||||
? raw_url
|
||||
: raw_url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
|
||||
$.info(
|
||||
`上传配置完成\n文件列表: ${Object.keys(files).join(
|
||||
', ',
|
||||
)}\n当前文件: ${encodeURIComponent(
|
||||
artifact.name,
|
||||
)}\n响应返回的原始链接: ${raw_url}\n处理完的新链接: ${new_url}`,
|
||||
);
|
||||
artifact.url = new_url;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,7 @@ async function downloadSubscription(req, res) {
|
||||
|
||||
if (
|
||||
sub.source !== 'local' ||
|
||||
['localFirst', 'remoteFirst'].includes(sub.mergeSources) ||
|
||||
url
|
||||
['localFirst', 'remoteFirst'].includes(sub.mergeSources)
|
||||
) {
|
||||
try {
|
||||
url = `${url || sub.url}`
|
||||
|
@ -563,10 +563,19 @@ async function syncArtifacts() {
|
||||
files.map((item) => [item.path, item]),
|
||||
);
|
||||
}
|
||||
const url = files[encodeURIComponent(artifact.name)]?.raw_url;
|
||||
artifact.url = isGitLab
|
||||
? url
|
||||
: url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
|
||||
const raw_url =
|
||||
files[encodeURIComponent(artifact.name)]?.raw_url;
|
||||
const new_url = isGitLab
|
||||
? raw_url
|
||||
: raw_url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
|
||||
$.info(
|
||||
`上传配置完成\n文件列表: ${Object.keys(files).join(
|
||||
', ',
|
||||
)}\n当前文件: ${encodeURIComponent(
|
||||
artifact.name,
|
||||
)}\n响应返回的原始链接: ${raw_url}\n处理完的新链接: ${new_url}`,
|
||||
);
|
||||
artifact.url = new_url;
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,10 +669,18 @@ async function syncArtifact(req, res) {
|
||||
isGitLab = true;
|
||||
files = Object.fromEntries(files.map((item) => [item.path, item]));
|
||||
}
|
||||
const url = files[encodeURIComponent(artifact.name)]?.raw_url;
|
||||
artifact.url = isGitLab
|
||||
? url
|
||||
: url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
|
||||
const raw_url = files[encodeURIComponent(artifact.name)]?.raw_url;
|
||||
const new_url = isGitLab
|
||||
? raw_url
|
||||
: raw_url?.replace(/\/raw\/[^/]*\/(.*)/, '/raw/$1');
|
||||
$.info(
|
||||
`上传配置完成\n文件列表: ${Object.keys(files).join(
|
||||
', ',
|
||||
)}\n当前文件: ${encodeURIComponent(
|
||||
artifact.name,
|
||||
)}\n响应返回的原始链接: ${raw_url}\n处理完的新链接: ${new_url}`,
|
||||
);
|
||||
artifact.url = new_url;
|
||||
$.write(allArtifacts, ARTIFACTS_KEY);
|
||||
success(res, artifact);
|
||||
} catch (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user