Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
katydecorah committed Jun 5, 2024
1 parent 5d7cb6f commit 263e40a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions src/providers/isbn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<NewBook> {
export async function getIsbn(
options: BookParams,
isLibrofm = false
): Promise<NewBook> {
const { inputIdentifier, providers } = options;
let book;
const isLibrofm = inputIdentifier.startsWith("https://libro.fm");
const identifier = isLibrofm
? getLibrofmId(inputIdentifier)
: inputIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/librofm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 263e40a

Please sign in to comment.