mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 15:29:01 +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,12 +51,14 @@ 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) {
|
||||||
artifact.updated = new Date().getTime();
|
if (artifact.sync) {
|
||||||
// extract real url from gist
|
artifact.updated = new Date().getTime();
|
||||||
artifact.url = body.files[artifact.name].raw_url.replace(
|
// extract real url from gist
|
||||||
/\/raw\/[^/]*\/(.*)/,
|
artifact.url = body.files[artifact.name].raw_url.replace(
|
||||||
'/raw/$1',
|
/\/raw\/[^/]*\/(.*)/,
|
||||||
);
|
'/raw/$1',
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.write(allArtifacts, ARTIFACTS_KEY);
|
$.write(allArtifacts, ARTIFACTS_KEY);
|
||||||
|
@ -201,12 +201,14 @@ 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) {
|
||||||
artifact.updated = new Date().getTime();
|
if (artifact.sync) {
|
||||||
// extract real url from gist
|
artifact.updated = new Date().getTime();
|
||||||
artifact.url = body.files[artifact.name].raw_url.replace(
|
// extract real url from gist
|
||||||
/\/raw\/[^/]*\/(.*)/,
|
artifact.url = body.files[artifact.name].raw_url.replace(
|
||||||
'/raw/$1',
|
/\/raw\/[^/]*\/(.*)/,
|
||||||
);
|
'/raw/$1',
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.write(allArtifacts, ARTIFACTS_KEY);
|
$.write(allArtifacts, ARTIFACTS_KEY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user