mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
Compare commits
3 Commits
2.13.2
...
fix-negati
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bac04587b8 | ||
|
|
06d0c14abc | ||
|
|
029900085c |
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -51,4 +51,4 @@ jobs:
|
|||||||
./backend/dist/sub-store-0.min.js
|
./backend/dist/sub-store-0.min.js
|
||||||
./backend/dist/sub-store-1.min.js
|
./backend/dist/sub-store-1.min.js
|
||||||
./backend/dist/sub-store-parser.loon.min.js
|
./backend/dist/sub-store-parser.loon.min.js
|
||||||
./backend/dist/cron-sync-artifacts.js
|
./backend/dist/cron-sync-artifacts.min.js
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.13.2",
|
"version": "2.13.5",
|
||||||
"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);
|
||||||
|
|||||||
@@ -66,8 +66,12 @@ async function getFlowInfo(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// unit is KB
|
// unit is KB
|
||||||
const upload = Number(flowHeaders.match(/upload=(\d+)/)[1]);
|
const uploadMatch = flowHeaders.match(/upload=(-?)(\d+)/)
|
||||||
const download = Number(flowHeaders.match(/download=(\d+)/)[1]);
|
const upload = Number(uploadMatch[1] + uploadMatch[2]);
|
||||||
|
|
||||||
|
const downloadMatch = flowHeaders.match(/download=(-?)(\d+)/)
|
||||||
|
const download = Number(downloadMatch[1] + downloadMatch[2]);
|
||||||
|
|
||||||
const total = Number(flowHeaders.match(/total=(\d+)/)[1]);
|
const total = Number(flowHeaders.match(/total=(\d+)/)[1]);
|
||||||
|
|
||||||
// optional expire timestamp
|
// optional expire timestamp
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user