Compare commits

..

No commits in common. "03c2fe0cc78633e684d5e63c81ee87ba7cd560cd" and "577f6bb0bd3bc002de2e5fa1dc8c102618f202f3" have entirely different histories.

4 changed files with 2 additions and 57 deletions

View File

@ -396,8 +396,7 @@
return {
authors: options.records.map((record) => ({
authorId: record.authorId,
authorName: record.authorName,
...record.coreUserId ? { authorUid: record.coreUserId } : {}
authorName: record.authorName
})),
batchName,
createdAt: options.createdAt,
@ -443,7 +442,6 @@
return {
authorId: readString(readMarketFieldValue(row, attributeDatas, "star_id")) ?? readString(readMarketFieldValue(row, attributeDatas, "id")) ?? "",
authorName: readString(readMarketFieldValue(row, attributeDatas, "nickname")) ?? readString(readMarketFieldValue(row, attributeDatas, "nick_name")) ?? "",
coreUserId: readString(readMarketFieldValue(row, attributeDatas, "core_user_id")) ?? void 0,
exportFields: buildMarketExportFieldFallbacks(row, attributeDatas),
hasDirectRatesSource: true,
location: readMarketLocation(row, attributeDatas),
@ -1739,7 +1737,6 @@
return {
authorId: readString2(record.authorId) ?? "",
authorName: readString2(record.authorName) ?? "",
coreUserId: readString2(record.coreUserId) ?? void 0,
exportFields: readSerializedExportFields(record),
hasDirectRatesSource: Boolean(singleVideoAfterSearchRate),
location: readString2(record.location) ?? void 0,
@ -1962,7 +1959,6 @@
return {
authorId: preferredRow.authorId || baseRow.authorId,
authorName: preferredRow.authorName || baseRow.authorName,
coreUserId: mergeNonEmptyString(baseRow.coreUserId, preferredRow.coreUserId),
exportFields: mergeExportFieldMaps(baseRow.exportFields, preferredRow.exportFields),
hasDirectRatesSource: preferredRow.hasDirectRatesSource || baseRow.hasDirectRatesSource,
location: mergeNonEmptyString(baseRow.location, preferredRow.location),
@ -2435,7 +2431,6 @@
...existingRecord,
...incomingRecord,
authorName: mergeStringValue(existingRecord.authorName, incomingRecord.authorName) ?? "",
coreUserId: mergeStringValue(existingRecord.coreUserId, incomingRecord.coreUserId),
exportFields: mergeFieldMap(
existingRecord.exportFields,
incomingRecord.exportFields
@ -3223,7 +3218,6 @@
...existingRecord,
...incomingRecord,
authorName: mergeStringValue2(existingRecord.authorName, incomingRecord.authorName) ?? "",
coreUserId: mergeStringValue2(existingRecord.coreUserId, incomingRecord.coreUserId),
exportFields: mergeFieldMap2(
existingRecord.exportFields,
incomingRecord.exportFields
@ -3314,10 +3308,6 @@
const existingRecord = records.get(row.authorId);
if (existingRecord) {
existingRecord.authorName = mergeStringValue3(existingRecord.authorName, row.authorName) ?? existingRecord.authorName;
existingRecord.coreUserId = mergeStringValue3(
existingRecord.coreUserId,
row.coreUserId
);
existingRecord.location = mergeStringValue3(
existingRecord.location,
row.location
@ -3935,10 +3925,6 @@
function toMarketRecord(rowSnapshot) {
const existingRecord = resultStore.getRecord(rowSnapshot.authorId);
const authorName = mergeStringValue4(existingRecord?.authorName, rowSnapshot.authorName) ?? "";
const coreUserId = mergeStringValue4(
existingRecord?.coreUserId,
rowSnapshot.coreUserId
);
const location2 = mergeStringValue4(existingRecord?.location, rowSnapshot.location);
const price21To60s = mergeStringValue4(
existingRecord?.price21To60s,
@ -3953,7 +3939,6 @@
rowSnapshot.backendMetrics
),
backendMetricsStatus: existingRecord?.backendMetricsStatus ?? "idle",
coreUserId,
exportFields: withExportFieldFallbacks(
mergeFieldMap4(existingRecord?.exportFields, rowSnapshot.exportFields),
{

View File

@ -58,7 +58,6 @@
return {
authorId: readString(readMarketFieldValue(row, attributeDatas, "star_id")) ?? readString(readMarketFieldValue(row, attributeDatas, "id")) ?? "",
authorName: readString(readMarketFieldValue(row, attributeDatas, "nickname")) ?? readString(readMarketFieldValue(row, attributeDatas, "nick_name")) ?? "",
coreUserId: readString(readMarketFieldValue(row, attributeDatas, "core_user_id")) ?? void 0,
exportFields: buildMarketExportFieldFallbacks(row, attributeDatas),
hasDirectRatesSource: true,
location: readMarketLocation(row, attributeDatas),
@ -505,7 +504,6 @@
return {
authorId: readString2(row.star_id) ?? readString2(attributeDatas.id) ?? "",
authorName: readString2(attributeDatas.nickname) ?? readString2(row.nick_name) ?? "",
coreUserId: readString2(attributeDatas.core_user_id) ?? void 0,
singleVideoAfterSearchRate
};
}).filter((row) => Boolean(row.authorId || row.authorName));

View File

@ -1 +1 @@
export const DEFAULT_BATCH_SUBMIT_BASE_URL = "http://192.168.31.21:8083";
export const DEFAULT_BATCH_SUBMIT_BASE_URL = "http://localhost:8083";

View File

@ -126,42 +126,4 @@ describe("market-page-bridge", () => {
})
);
});
test("serializes core user ids from the live market list", async () => {
const marketRoot = document.querySelector(".base-author-list") as HTMLElement & {
__vue__?: {
_setupState?: Record<string, unknown>;
};
};
marketRoot.__vue__ = {
_setupState: {
marketState: {
marketList: [
{
attribute_datas: {
avg_search_after_view_rate_30d: "0.1234",
core_user_id: "core-111",
nickname: "搜索达人"
},
star_id: "search-1"
}
]
}
}
};
await import("../src/content/market/page-bridge");
expect(
JSON.parse(
document.documentElement.getAttribute("data-sces-market-rows") ?? "[]"
)
).toEqual([
expect.objectContaining({
authorId: "search-1",
authorName: "搜索达人",
coreUserId: "core-111"
})
]);
});
});