Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gu imageworks extension
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joetsuihk
gu imageworks extension
Commits
566e59a1
Commit
566e59a1
authored
Feb 22, 2022
by
edwin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
combine ECAsset and GlobalAsset result
parent
974be349
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
fetch.js
fetch/fetch.js
+7
-11
No files found.
fetch/fetch.js
View file @
566e59a1
...
...
@@ -93,14 +93,14 @@
// fetch product URL
let
currentms
=
new
Date
().
getTime
();
let
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=main_product%2FGU%2F
${
SKU
}
&t=datacategory%2Fecasset&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
product image
`
);
let
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=main_product%2FGU%2F
${
SKU
}
&t=datacategory%2Fecasset&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
ECAsset
`
);
let
DOMString
=
createDOMString
(
SKU
,
assetlist
);
container
.
insertAdjacentHTML
(
'beforeend'
,
DOMString
);
clientSideFilter
();
// fetch model URL
currentms
=
new
Date
().
getTime
();
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=datacategory%2Fasset&w=
${
SKU
}
&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
model image
`
);
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=datacategory%2Fasset&w=
${
SKU
}
&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
GlobalAsset
`
);
DOMString
=
createDOMString
(
SKU
,
assetlist
);
container
.
insertAdjacentHTML
(
'beforeend'
,
DOMString
);
clientSideFilter
();
...
...
@@ -183,24 +183,20 @@
// first link
let
currentms
=
new
Date
().
getTime
();
let
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=main_product%2FGU%2F
${
SKU
}
&t=datacategory%2Fecasset&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
product image
`
);
let
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=main_product%2FGU%2F
${
SKU
}
&t=datacategory%2Fecasset&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
ECAsset
`
);
let
downloadlist
=
filtering
(
assetlist
,
SKU
);
await
downloadList
(
downloadlist
[
"product"
],
`
${
SKU
}
`
);
await
sleep
(
sleepTime
);
let
is_old
=
assetlist
.
length
===
0
;
let
productlist
=
downloadlist
[
"product"
]
;
let
modellist
=
downloadlist
[
"model"
];
// second link
currentms
=
new
Date
().
getTime
();
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=datacategory%2Fasset&w=
${
SKU
}
&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
model image
`
);
assetlist
=
await
fetchSKU
(
`
${
baseurl
}
api/asset?time=
${
currentms
}
&t=datacategory%2Fasset&w=
${
SKU
}
&r=north&z=
${
fetchNumber
}
&c=DEFAULT`
,
`
${
SKU
}
GlobalAsset
`
);
downloadlist
=
filtering
(
assetlist
,
SKU
);
if
(
is_old
){
addDebugMessage
(
`re-attempt download product list`
);
await
downloadList
(
downloadlist
[
"product"
],
`
${
SKU
}
`
);
await
sleep
(
sleepTime
);
}
await
downloadList
(
downloadlist
[
"product"
].
concat
(
productlist
),
`
${
SKU
}
`
);
await
sleep
(
sleepTime
);
await
downloadList
(
downloadlist
[
"model"
].
concat
(
modellist
),
`
${
SKU
}
_model`
);
await
sleep
(
sleepTime
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment