nixamp 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enrich.js +5 -1
- package/package.json +1 -1
- package/src/enrich.ts +4 -1
- package/web/dist/sw.js +1 -1
package/dist/enrich.js
CHANGED
|
@@ -79,11 +79,15 @@ export function pickBest(answer, asked) {
|
|
|
79
79
|
(askedPlain.startsWith(`${titlePlain} `) || titlePlain.startsWith(`${askedPlain} `));
|
|
80
80
|
if (!exact && score < (prefix ? PREFIX_SCORE : MIN_SCORE))
|
|
81
81
|
continue;
|
|
82
|
-
// An exact title beats any score; among
|
|
82
|
+
// An exact title beats any score; among exact titles the one with a
|
|
83
|
+
// picture wins, since nichedb keeps both the IMDb row and the TMDB row of
|
|
84
|
+
// a film and only one has the poster; among the rest, the score decides.
|
|
83
85
|
if (!best)
|
|
84
86
|
best = item;
|
|
85
87
|
else if (exact && !isExact(best))
|
|
86
88
|
best = item;
|
|
89
|
+
else if (exact && isExact(best) && !best.image_url && item.image_url)
|
|
90
|
+
best = item;
|
|
87
91
|
else if (!isExact(best) && score > Number(best.score ?? 0))
|
|
88
92
|
best = item;
|
|
89
93
|
}
|
package/package.json
CHANGED
package/src/enrich.ts
CHANGED
|
@@ -126,9 +126,12 @@ export function pickBest(answer: MatchAnswer, asked: string): Enriched | null {
|
|
|
126
126
|
askedPlain.length >= 4 &&
|
|
127
127
|
(askedPlain.startsWith(`${titlePlain} `) || titlePlain.startsWith(`${askedPlain} `));
|
|
128
128
|
if (!exact && score < (prefix ? PREFIX_SCORE : MIN_SCORE)) continue;
|
|
129
|
-
// An exact title beats any score; among
|
|
129
|
+
// An exact title beats any score; among exact titles the one with a
|
|
130
|
+
// picture wins, since nichedb keeps both the IMDb row and the TMDB row of
|
|
131
|
+
// a film and only one has the poster; among the rest, the score decides.
|
|
130
132
|
if (!best) best = item;
|
|
131
133
|
else if (exact && !isExact(best)) best = item;
|
|
134
|
+
else if (exact && isExact(best) && !best.image_url && item.image_url) best = item;
|
|
132
135
|
else if (!isExact(best) && score > Number(best.score ?? 0)) best = item;
|
|
133
136
|
}
|
|
134
137
|
if (!best) return null;
|
package/web/dist/sw.js
CHANGED