@astrofoundry/trendarr 0.9.0 → 0.9.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/commands/books.js +4 -2
- package/package.json +1 -1
package/dist/commands/books.js
CHANGED
|
@@ -72,8 +72,10 @@ export async function searchBooks(config, query, opts) {
|
|
|
72
72
|
return { output: { books, kindles }, warnings };
|
|
73
73
|
}
|
|
74
74
|
async function findFormat(client, foreignBookId, format) {
|
|
75
|
-
const found =
|
|
76
|
-
|
|
75
|
+
const found = await client.lookup(foreignBookId);
|
|
76
|
+
const exact = found.filter((b) => b.foreignBookId === foreignBookId);
|
|
77
|
+
const pool = exact.length > 0 ? exact : found;
|
|
78
|
+
return pool.find((b) => b.mediaType === format) ?? pool[0] ?? null;
|
|
77
79
|
}
|
|
78
80
|
async function ensureBook(client, lookup, format, opts) {
|
|
79
81
|
const local = preferred(lookup[format]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrofoundry/trendarr",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "TMDB trending → OMDb ratings → Radarr/Sonarr adds → SABnzbd control, from the terminal",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -p tsconfig.build.json && chmod +x dist/cli.js",
|