fix(identity): include episode and recognition words in resolve idempotency
This commit is contained in:
1 parent
864856c9bb
commit
27386ba9df
3 files changed
+39
-4
No files matched your search
@@ -118,10 +118,22 @@ export interface ResolveResult {
|
||||
const candKey = (c: DomainCandidate) =>
|
||||
c.localEntityId ? `local:${c.localEntityId}` : `${c.provider}:${c.entityType}:${c.externalId}`;
|
||||
|
||||
/** 作品候选与季集映射输入一起判幂等;全局词改编号/发布组时必须重算。 */
|
||||
export function evidenceVersion(parsed: ParsedRelease | null, ranked: RankedCandidate[]): string {
|
||||
const h = createHash("sha1")
|
||||
.update(
|
||||
JSON.stringify([parsed?.title ?? null, parsed?.year ?? null, ranked.map((r) => [candKey(r.candidate), r.level])]),
|
||||
JSON.stringify([
|
||||
parsed?.title ?? null,
|
||||
parsed?.year ?? null,
|
||||
parsed?.season ?? null,
|
||||
parsed?.seasonEnd ?? null,
|
||||
parsed?.seasonInferred ?? false,
|
||||
parsed?.episodes ?? null,
|
||||
parsed?.airDate ?? null,
|
||||
parsed?.releaseGroup?.name ?? null,
|
||||
parsed?.words?.applied ?? [],
|
||||
ranked.map((r) => [candKey(r.candidate), r.level]),
|
||||
]),
|
||||
)
|
||||
.digest("hex")
|
||||
.slice(0, 16);
|
||||
|
||||
Reference in new issue
Block a user