mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-12 02:09:03 +08:00
fix: sync artifacts issue (#164)
This commit is contained in:
parent
029900085c
commit
06d0c14abc
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.13.3",
|
"version": "2.13.4",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -51,6 +51,7 @@ async function doSync() {
|
|||||||
const body = JSON.parse(resp.body);
|
const body = JSON.parse(resp.body);
|
||||||
|
|
||||||
for (const artifact of allArtifacts) {
|
for (const artifact of allArtifacts) {
|
||||||
|
if (artifact.sync) {
|
||||||
artifact.updated = new Date().getTime();
|
artifact.updated = new Date().getTime();
|
||||||
// extract real url from gist
|
// extract real url from gist
|
||||||
artifact.url = body.files[artifact.name].raw_url.replace(
|
artifact.url = body.files[artifact.name].raw_url.replace(
|
||||||
@ -58,6 +59,7 @@ async function doSync() {
|
|||||||
'/raw/$1',
|
'/raw/$1',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.write(allArtifacts, ARTIFACTS_KEY);
|
$.write(allArtifacts, ARTIFACTS_KEY);
|
||||||
$.notify('🌍 Sub-Store', '全部订阅同步成功!');
|
$.notify('🌍 Sub-Store', '全部订阅同步成功!');
|
||||||
|
@ -201,6 +201,7 @@ async function syncAllArtifacts(_, res) {
|
|||||||
const body = JSON.parse(resp.body);
|
const body = JSON.parse(resp.body);
|
||||||
|
|
||||||
for (const artifact of allArtifacts) {
|
for (const artifact of allArtifacts) {
|
||||||
|
if (artifact.sync) {
|
||||||
artifact.updated = new Date().getTime();
|
artifact.updated = new Date().getTime();
|
||||||
// extract real url from gist
|
// extract real url from gist
|
||||||
artifact.url = body.files[artifact.name].raw_url.replace(
|
artifact.url = body.files[artifact.name].raw_url.replace(
|
||||||
@ -208,6 +209,7 @@ async function syncAllArtifacts(_, res) {
|
|||||||
'/raw/$1',
|
'/raw/$1',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.write(allArtifacts, ARTIFACTS_KEY);
|
$.write(allArtifacts, ARTIFACTS_KEY);
|
||||||
$.info('全部订阅同步成功!');
|
$.info('全部订阅同步成功!');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user