Closed maksz42 closed 8 months ago
At the moment, is seems that JLCPCB doesn't provide this flag via their API.
I've just found this issue too. Potentially a baked-in list of the Basic/EP item codes would suffice. My understanding is that these shouldn't change very often, to provide design stability. (That said, sometimes they do - C2293 was previously Basic and is now Extended.)
Looks like all preferred parts can be obtained with a single request (additional requests may be needed to get cookies, tokens, etc) There are currently 300 preferred parts and more and more are getting moved from basic to preferred category. We can request all preferred parts using "pageSize" field And the response contains a list of all preferred parts. So an additional step could be added during the database build process to mark those parts as preferred. @yaqwsx What do you think?
@maksz42: This looks good! But I prefer if you post it as text instructions to obtain the data. It is not particularly easy to deduce it from your screenshots.
Implementation-wise: I suggest adding a new component table column in the cache DB preferred
. We add a new update step where we remove all preferred flags and set it only for the newly fetched components. When we build data tables from the cache DB, we will infer whether components are basic, preferred, or extended.
@yaqwsx I opened a PR. Since it's only a single request and I can't test it on cache DB, I added it to buildtables
. So you'll need to change that if you want to keep this task offline.
I just took the API from https://jlcpcb.com/parts/basic_parts and removed headers and fields that seem like they don't matter. First we need to obtain xsrf token and then query jlcpcb for preferred parts.
Implemented in bb8f3311.
I was upset because lmv321 became an extended part but then I saw this in jlcpcb's browser : Looks like now there is a whole subset of extended parts that they don't charge a fee to assemble? Here is a list of these: https://jlcpcb.com/parts/basic_parts Would be great to have this in jlcparts :+1: