diff --git a/dist/index.js b/dist/index.js index 80ae0659..88a75133 100644 --- a/dist/index.js +++ b/dist/index.js @@ -99435,10 +99435,9 @@ function checkOutBook(bookParams, library) { -async function getIsbn(options) { +async function getIsbn(options, isLibrofm = false) { const { inputIdentifier, providers } = options; let book; - const isLibrofm = inputIdentifier.startsWith("https://libro.fm"); const identifier = isLibrofm ? getLibrofmId(inputIdentifier) : inputIdentifier; @@ -116922,7 +116921,7 @@ async function getLibrofm(options) { ...options, providers: ["librofm"], }; - const book = await getIsbn(newOptions); + const book = await getIsbn(newOptions, true); return book; } catch (error) { diff --git a/src/providers/isbn.ts b/src/providers/isbn.ts index 92a3ca19..3323cfc3 100644 --- a/src/providers/isbn.ts +++ b/src/providers/isbn.ts @@ -4,10 +4,12 @@ import { NewBook } from "../new-book"; import { formatDescription, getLibrofmId } from "../utils"; import { exportVariable, getInput, warning } from "@actions/core"; -export async function getIsbn(options: BookParams): Promise { +export async function getIsbn( + options: BookParams, + isLibrofm = false +): Promise { const { inputIdentifier, providers } = options; let book; - const isLibrofm = inputIdentifier.startsWith("https://libro.fm"); const identifier = isLibrofm ? getLibrofmId(inputIdentifier) : inputIdentifier; diff --git a/src/providers/librofm.ts b/src/providers/librofm.ts index 414adfc2..465f0053 100644 --- a/src/providers/librofm.ts +++ b/src/providers/librofm.ts @@ -10,7 +10,7 @@ export async function getLibrofm( ...options, providers: ["librofm"], }; - const book = await getIsbn(newOptions); + const book = await getIsbn(newOptions, true); return book; } catch (error) { throw new Error(`Failed to get book from Libro.fm: ${error.message}`);