Prefer CN device matches
This commit is contained in:
@@ -1688,7 +1688,10 @@ NOH-AL00 -> nohal00</pre>
|
||||
}
|
||||
|
||||
function isCnSourceFile(sourceFile) {
|
||||
return /_cn\.md$/i.test(sourceFile || "");
|
||||
const source = String(sourceFile || "").trim().toLowerCase();
|
||||
if (!source) return false;
|
||||
if (source === "local/manual_catalog.json") return true;
|
||||
return !(/_en\.md$/i.test(source) || /_global_en\.md$/i.test(source));
|
||||
}
|
||||
|
||||
function buildInitialSourceOrder() {
|
||||
@@ -2045,7 +2048,9 @@ NOH-AL00 -> nohal00</pre>
|
||||
const topBase = brandStrictMatches.length
|
||||
? brandStrictMatches
|
||||
: (manufacturerStrictMatches.length ? manufacturerStrictMatches : allMatches);
|
||||
const top = topBase.slice(0, 200);
|
||||
const preferredTopBase = topBase.filter((x) => isCnSourceFile(x.record && x.record.source_file));
|
||||
const topSourceBase = preferredTopBase.length ? preferredTopBase : topBase;
|
||||
const top = topSourceBase.slice(0, 1);
|
||||
|
||||
const best = top.length ? top[0] : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user