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 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 the rest, the score decides.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nixamp",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "It really whips the terminal's ass. A Winamp-shaped audio player for your terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
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 the rest, the score decides.
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
@@ -1,5 +1,5 @@
1
1
  /* nixamp service worker — generated, do not edit */
2
- const CACHE = "nixamp-1789049456452";
2
+ const CACHE = "nixamp-1789049889297";
3
3
  const PRECACHE = [
4
4
  "/",
5
5
  "/apple-touch-icon.png",